lyqu 4 سال پیش
والد
کامیت
940eaac4ca
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      components/homeViews/mine-view.vue

+ 5 - 4
components/homeViews/mine-view.vue

@@ -99,19 +99,20 @@
 			}
 		},
 		mounted() {
-			if (this.$u.test.isEmpty(uni.getStorageSync("userId"))) {
+			let userId = uni.getStorageSync("userId")
+			if (this.$u.test.isEmpty(userId)) {
 				this.isLogin = false;
 			} else {
 				this.isLogin = true;
-				this.getUserInfo();
+				this.getUserInfo(userId);
 			}
 		},
 		methods: {
 			toAuth() {
 				 window.location.href = authUrl(this.activityId);
 			},
-			getUserInfo() {
-				this.$u.api.user.detail({id: this.userId}).then(res => {
+			getUserInfo(userId) {
+				this.$u.api.user.detail({id: userId}).then(res => {
 					this.userData = res;
 				})
 			},