张文飞 3 lat temu
rodzic
commit
638e5a427a
2 zmienionych plików z 11 dodań i 11 usunięć
  1. 1 3
      components/subComponents/dmLogin.vue
  2. 10 8
      pages/homePage/homePage.vue

+ 1 - 3
components/subComponents/dmLogin.vue

@@ -51,7 +51,6 @@
 			   timer:null,
 			   countdownTimes:120,
 			   agree:false,
-			   userId:"",
 			}
 		},
 		methods:{
@@ -148,7 +147,7 @@
 					data: {
 						"code": this.verifity,
 						"phone": this.mobile,
-						"userId": this.userId,
+						"userId": this.$cache.get('_user_id'),
 						"projectId": getApp().globalData.projectId||"",
 						"shareToken": getApp().globalData.shareToken||"",
 					}
@@ -174,7 +173,6 @@
 			}
 		},
 		mounted() {
-			this.userId = this.$cache.get('_user_id')
 			uni.$on('login',()=>{
 				this.show();
 			})

+ 10 - 8
pages/homePage/homePage.vue

@@ -277,14 +277,16 @@
 				}
 			},
 			async getUserInfo() {
-				let ret = await this.$myRequest({
-					url: "/user/userInfo",
-					data: {},
-					method: "GET"
-				});
-				if (ret.data.success) {
-					this.userInfo = ret.data.single || null;
-					this.showGuide = this.userInfo.userId?this.userInfo.ownersUnion?false:true:true;
+				if(app.globalData.userId){
+					let ret = await this.$myRequest({
+						url: "/user/userInfo",
+						data: {},
+						method: "GET"
+					});
+					if (ret.data.success) {
+						this.userInfo = ret.data.single || null;
+						this.showGuide = this.userInfo.userId?this.userInfo.ownersUnion?false:true:true;
+					}
 				}
 			},
 			// 调准项目详情