旅游教育出版社-数字教材移动端
QYF-GitLab1
14 小时以前 8e3ee81b6ed824866734b7034604121f370f4201
src/main.js
@@ -54,16 +54,16 @@
      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 {
@@ -72,13 +72,12 @@
    } 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;
@@ -103,11 +102,11 @@
         */
        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];
@@ -127,7 +126,7 @@
              }
            }
          })
          .catch(res => {
          .catch((res) => {
            console.log(res);
          });
      } else {
@@ -138,7 +137,8 @@
        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");
@@ -153,5 +153,5 @@
new Vue({
  router,
  store,
  render: h => h(App)
  render: (h) => h(App),
}).$mount("#app");