| | |
| | | if (bindingCode.code) { |
| | | let query = { |
| | | code: bindingCode.code, |
| | | isSocial: true // 公众号和开放平台是不同的主体,公众号绑定微信使用isSocial=true,开放平台(扫码绑定)使用isSocial=false; |
| | | isSocial: true, // 公众号和开放平台是不同的主体,公众号绑定微信使用isSocial=true,开放平台(扫码绑定)使用isSocial=false; |
| | | }; |
| | | MG.identity |
| | | .bindWeChat(query) |
| | | .then(res => { |
| | | .then((res) => { |
| | | const url = window.location.href; |
| | | const redirectUrl = url.split("?")[0]; |
| | | window.location.href = redirectUrl; |
| | | }) |
| | | .catch(res => { |
| | | .catch((res) => { |
| | | console.log(res); |
| | | }); |
| | | } else { |
| | |
| | | } else { |
| | | // 拦截如果是登录code |
| | | let loginCode = WeChat.getUrlInfo("weChatLogin"); |
| | | console.log(loginCode, "loginCode"); |
| | | if (loginCode.code) { |
| | | WeChat.login(loginCode.code, data => { |
| | | WeChat.login(loginCode.code, (data) => { |
| | | toolClass.setCookie(config.tokenKey, data); |
| | | const url = window.location.href; |
| | | const domian = url.split("?")[0]; |
| | | console.log(domian, 'domian'); |
| | | console.log(domian, "domian"); |
| | | const routeCode = url.split("#")[1]; |
| | | const redirectUrl = domian + "#" + routeCode; |
| | | window.location.href = redirectUrl; |
| | |
| | | */ |
| | | let query = { |
| | | code: checkCode.code, |
| | | appCode: config.appRefCode |
| | | appCode: config.appRefCode, |
| | | }; |
| | | MG.identity |
| | | .chechWechatAccount(query) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res == true) { |
| | | const url = window.location.href; |
| | | const domian = url.split("?")[0]; |
| | |
| | | } |
| | | } |
| | | }) |
| | | .catch(res => { |
| | | .catch((res) => { |
| | | console.log(res); |
| | | }); |
| | | } else { |
| | |
| | | if (ua.match(/MicroMessenger/i) == "micromessenger") { |
| | | toolClass.delCookie(config.tokenKey); |
| | | localStorage.fullPath = to.fullPath; |
| | | window.location.href = config.requestCtx + "/mobile/textbooks/#" + to.fullPath; |
| | | window.location.href = |
| | | config.requestCtx + "/mobile/textbooks/#" + to.fullPath; |
| | | WeChat.getCode("checkWeChat"); |
| | | } else { |
| | | WeChat.getCode("weChatLogin"); |
| | |
| | | new Vue({ |
| | | router, |
| | | store, |
| | | render: h => h(App) |
| | | render: (h) => h(App), |
| | | }).$mount("#app"); |