| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import Vue from 'vue';
- import { getTicketFun } from '@/utils/TXApiFun';
- // 微信JSSDK实例
- const wx = Vue.prototype.wx;
- import { wxLogin } from '@/api/digest';
- export function WXdigest() {
- // wx.login({
- // suiteId: 'wwxxxxxx', //非必填,第三方应用的suiteid,自建应用不填。若第三方小程序绑定多个第三方应用时,建议填上该字段
- // success: function (res) {
- // console.log(res);
- // },
- // fail: function (res) {
- // console.log(res);
- // },
- // complete: function (res) {
- // console.log(res);
- // },
- // });
- getTicketFun(['getCurExternalContact'], 'agentConfig')
- .then((res) => {
- window.open(
- `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.appId}&redirect_uri=ssbsfatest.nipponpaint.com.cn/mobile/&response_type=code&scope=SCOPE&state=STATE#wechat_redirect`
- );
- // 获取用户code
- // getWeChatCode();
- })
- .catch((err) => {
- console.log(err);
- });
- }
- function getWeChatCode() {
- wx.invoke('getCurExternalContact', {}, (res) => {
- if (res.err_msg === 'getCurExternalContact:ok') {
- console.log(res);
- } else {
- console.log(res);
- }
- });
- }
|