张文飞 vor 3 Jahren
Ursprung
Commit
5db2dce898
3 geänderte Dateien mit 16 neuen und 11 gelöschten Zeilen
  1. 1 0
      App.vue
  2. 12 9
      pages/homePage/homePage.vue
  3. 3 2
      util/api.js

+ 1 - 0
App.vue

@@ -54,6 +54,7 @@
 			let token = this.$cache.get('_token_owner_union');
 			let userId =  this.$cache.get('_user_id');
 			if (!token) {
+				this.globalData.userId = userId;
 				this.regist();
 			} else {
 				this.globalData.token = token;

+ 12 - 9
pages/homePage/homePage.vue

@@ -298,15 +298,18 @@
 				})
 				if (ret.data.success) {
 				   let single = ret.data.single||null;//:0待审核1通过2拒绝
-					if(single.approvalStatus==0||single.approvalStatus==1){
-						uni.navigateTo({
-							url: '../certificationResultPage/certificationResultPage'
-						})
-					}else{
-						uni.navigateTo({
-							url: '../ownerCertification/ownerCertification'
-						})
-					}
+				   if(single){
+					   if(single.approvalStatus==0||single.approvalStatus==1){
+							uni.navigateTo({
+								url: '../certificationResultPage/certificationResultPage'
+							})
+					   }
+				   }else{
+					   uni.navigateTo({
+					   	url: '../ownerCertification/ownerCertification'
+					   })
+				   }
+					
 				}else{
 					uni.showToast({
 						icon:"none",

+ 3 - 2
util/api.js

@@ -2,7 +2,8 @@ let isToLoginSend = false;
 var requestTask = null
 var elabprojectname = ''
 var elabsystem = ''
-var elabEnvironment = ''
+var elabEnvironment = '';
+import MinCache from '../static/cache.js'
 export const myRequest = (options) => {
 	if (!options.hasOwnProperty("showLoading")) {
 		var localDate = uni.getStorageSync('loadingStamp') || 0
@@ -15,7 +16,7 @@ export const myRequest = (options) => {
 			})
 		}
 	}
-	let token = getApp().globalData.token
+	let token = (new MinCache()).get('_token_owner_union')
 	if (token) {
 		options.token = token
 	} else {