shish před 4 roky
rodič
revize
11cb236ef5

+ 4 - 1
ghsApp/src/api/common/index.js

@@ -48,4 +48,7 @@ export const initSocket = async clientId => {
 };
 };
 
 
 //app登陆
 //app登陆
-export const appLogin = data => https.get("/auth/app-login", data);
+export const appLogin = data => https.get("/auth/app-login", data);
+
+//app重新获取登陆信息
+export const appReGetLoginInfo = data => https.get("/admin/app-re-get-login-info", data);

+ 3 - 0
ghsApp/src/manifest.json

@@ -11,6 +11,9 @@
         "nvueCompiler" : "uni-app",
         "nvueCompiler" : "uni-app",
         "compilerVersion" : 3,
         "compilerVersion" : 3,
         "nvueLaunchMode" : "fast",
         "nvueLaunchMode" : "fast",
+        "compatible": {  
+            "ignoreVersion": true
+        },
         "splashscreen" : {
         "splashscreen" : {
             "alwaysShowBeforeRender" : true,
             "alwaysShowBeforeRender" : true,
             "waiting" : true,
             "waiting" : true,

+ 21 - 5
ghsApp/src/mixins/globalMixins.js

@@ -1,8 +1,9 @@
+import store from '@/store'
 import { mapGetters,mapActions } from 'vuex'
 import { mapGetters,mapActions } from 'vuex'
 import { pageTo, isLogin } from '@/utils/util.js'
 import { pageTo, isLogin } from '@/utils/util.js'
 import { getUser, uniLoginFn } from '@/utils/auth'
 import { getUser, uniLoginFn } from '@/utils/auth'
 import { postWxCode, getDictionaries } from '@/api/mini'
 import { postWxCode, getDictionaries } from '@/api/mini'
-import { getStaffApi } from '@/api/common'
+import { getStaffApi,appReGetLoginInfo } from '@/api/common'
 export default {
 export default {
 	data() {
 	data() {
 		return {
 		return {
@@ -83,10 +84,25 @@ export default {
       // #endif
       // #endif
 
 
       //#ifdef APP-PLUS
       //#ifdef APP-PLUS
-      this.show_login_model = true
-      //uni.hideTabBar()
-      // #endif
-
+      //有token重新获取登陆信息!!!
+      const appToken = uni.getStorageSync('token')
+      if(this.$util.isEmpty(appToken)){
+        this.show_login_model = true
+        uni.hideTabBar()
+      }else{
+        appReGetLoginInfo().then(subRes=>{
+          store.commit('setLoginInfo', {
+            ...subRes.data.admin,
+            ...subRes.data
+          })
+        })
+        uni.showTabBar()
+				this.setUserShopAll()
+				if (this.init) {
+					this.init()
+				}
+      }
+      // #endif 
 
 
 		}
 		}