浏览代码

feat(KIP-6765): 适配子目录路径的接口

John-Hong 2 年之前
父节点
当前提交
c8bec9c6ea
共有 4 个文件被更改,包括 9 次插入6 次删除
  1. 3 0
      src/pages/login/login.vue
  2. 4 4
      src/pages/login/openWx.vue
  3. 1 1
      src/utils/login.js
  4. 1 1
      src/utils/request-kip.js

+ 3 - 0
src/pages/login/login.vue

@@ -422,6 +422,9 @@ export default {
               _this.queryMember();
               // 返回首页
               _this.$router.replace({ path: 'home' });
+              setTimeout(() => {
+                window.location.reload();
+              }, 100);
             } else {
               log.warn(`手机号登录请求成功: 未获取到授权信息`);
               uni.showModal({

+ 4 - 4
src/pages/login/openWx.vue

@@ -81,6 +81,7 @@ export default {
     },
     async getOpenId(code) {
       try {
+        /*
         // this.$store.commit('SET_OPENID', 'odJnI0-Y6ZJap-Ow9nmJH-4WyxhU');
         this.$store.commit('SET_OPENID', 'oEDin6CwQMev3iRu74IAsE4mYYwo'); // 参数公众号
         // 判断用户是否需要登录,
@@ -88,15 +89,14 @@ export default {
           this.$router.replace({
             path: 'home',
           });
-        });
-        /*
+        });*/
         // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
         const { appid, secret } = getAppIdByGroupIdAndMallId({
           groupId: this.$route.params.groupId,
           mallId: this.$route.params.mallId,
           type: 'all',
         });
-        // console.log(86, appid, secret, code);
+        console.log(99, appid, secret, code);
         // return;
         // ?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
         const res = await WxJsOpenId({
@@ -115,7 +115,7 @@ export default {
               path: 'home',
             });
           });
-        }*/
+        }
       } catch (err) {
         console.log(106, err);
       }

+ 1 - 1
src/utils/login.js

@@ -127,7 +127,7 @@ export function logout() {
  }>
  */
 export function WxJsOpenId(param) {
-  return request.get(`/sns/oauth2/access_token`, param);
+  return request.get(`/tparking/sns/oauth2/access_token`, param);
 }
 
 /**

+ 1 - 1
src/utils/request-kip.js

@@ -133,7 +133,7 @@ export default {
     };
     return new Promise((resolve, reject) => {
       const url = getUrl(
-        /\/sns|http/g.test(path) ? path : `${window.profileApi}${path}`
+        /tparking\/sns|http/g.test(path) ? path : `${window.profileApi}${path}`
       );
       // console.log(130, url);
       const { header } = handleConfig(config);