able99 4 years ago
parent
commit
6f0589afe8
2 changed files with 3 additions and 5 deletions
  1. 1 1
      config/api.js
  2. 2 4
      pages/user/index.vue

+ 1 - 1
config/api.js

@@ -7,7 +7,7 @@ module.exports = {
 	//  微信登录
 	WxLogin: WX_API_BASE + 'app/auth/user/wx/login',
 	//  获取个人信息
-	getMainInfo: WX_API_BASE + 'app/member/selectUserById/',
+	getMainInfo: WX_API_BASE + 'app/member/selectUserById',
 	//  获取商户信息
 	getMerchantsMainInfo: WX_API_BASE + '/app/merchants/selectMerchantsById/',
 	//  获取我的积分

+ 2 - 4
pages/user/index.vue

@@ -92,10 +92,8 @@
 				},
 			}
 		},
-		onLoad() {
-			this.userData = uni.getStorageSync("userData")
-		},
 		onShow() {
+			this.userData = uni.getStorageSync("userData")
 			this.getBaseData()
 		},
 		onPullDownRefresh() {
@@ -107,7 +105,7 @@
 		methods: {
 			//  获取全部数据
 			getBaseData() {
-				NET.request(API.getMainInfo + this.userData.userId, {}, 'GET').then(res => {
+				NET.request(API.getMainInfo, {}, 'GET').then(res => {
 					this.mainInfo = res.data
 				}).catch(error => {
 					this.$refs.uTips.show({