فهرست منبع

微信小程序登录逻辑梳理_v7

John-Hong 2 سال پیش
والد
کامیت
bcbfdedaa0
4فایلهای تغییر یافته به همراه16 افزوده شده و 16 حذف شده
  1. 1 1
      public/index.html
  2. 7 7
      src/App.vue
  3. 7 7
      src/store/index.js
  4. 1 1
      src/utils/request-kip.js

+ 1 - 1
public/index.html

@@ -18,7 +18,7 @@
     if (/dev-/.test(window?.injectConfig.api) || window.location.href.indexOf(8080) > -1) {
       window.injectConfig = {
         ...window.injectConfig,
-        api: 'https://qa-crm-kpl.kerryprops.com.cn/',
+        api: 'https://qa-crm-kpl.kerryprops.com.cn',
         TRACKING_API_URL:
           'https://qa-tracking-cip.kerryplus.com/sa?project=kerry_tracking',
         profileApi: 'https://qa-apim.kerryplus.com/c/api',

+ 7 - 7
src/App.vue

@@ -261,13 +261,13 @@ export default {
           callback: () => {
             // console.log(838383, this.isInit);
             this.isInit = true;
-            if (!openid) {
-              this.$router.replace({
-                path: '/openWx',
-                query: query,
-              });
-              return
-            }
+            // if (!openid) {
+            //   this.$router.replace({
+            //     path: '/openWx',
+            //     query: query,
+            //   });
+            //   return
+            // }
             // 当所有的数据都初始化之后再次执行
             this.getTicket();
           },

+ 7 - 7
src/store/index.js

@@ -149,21 +149,21 @@ const store = new Vuex.Store({
       const res = await kipGetUserDetail();
       console.log('user_info', res);
     },
-    async initH5({commit}) {
-      if(uni.getStorageSync('groupId')) {
+    async initH5({ commit }) {
+      if (uni.getStorageSync('groupId')) {
         this.$store.
-        this.$store.commit('SET_GROUP_ID', uni.getStorageSync('groupId'));
+          this.$store.commit('SET_GROUP_ID', uni.getStorageSync('groupId'));
       }
-      if(uni.getStorageSync('kipUserId')) {
+      if (uni.getStorageSync('kipUserId')) {
         this.$store.commit('SET_KIP_USER_ID', uni.getStorageSync('kipUserId'));
       }
-      if(uni.getStorageSync('mallId')) {
+      if (uni.getStorageSync('mallId')) {
         this.$store.commit('SET_MALL_ID', uni.getStorageSync('mallId'));
       }
-      if(uni.getStorageSync('openid')) {
+      if (uni.getStorageSync('openid')) {
         this.$store.commit('SET_OPENID', uni.getStorageSync('openid'));
       }
-      if(uni.getStorageSync('mobile')) {
+      if (uni.getStorageSync('mobile')) {
         this.$store.commit('SET_OPENID', uni.getStorageSync('mobile'));
       }
     }

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

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