Эх сурвалжийг харах

refactor:用户信息修改

zhanghui 2 жил өмнө
parent
commit
2ac8183a3c

+ 2 - 2
myPages/realNameAuth/index.vue

@@ -150,8 +150,8 @@ export default {
           })
 
           setTimeout(()=>{
-            uni.switchTab({
-              url: '/pages/my/index',
+            uni.navigateBack({
+              data:1,
             })
           },1000)
 

+ 11 - 4
myPages/userInfo/index.vue

@@ -132,9 +132,12 @@ export default {
 				uni.showToast({
 					title: "操作成功"
 				})
-				uni.navigateTo({
-					url: '/pages/index/tabbar',
-				})
+				// setTimeout(res=>{
+				// 	uni.switchTab({
+				// 		url: '/pages/index/index',
+				// 	},2000)
+				// })
+
 			}).catch(() =>{
 				uni.showToast({
 					title: "操作失败"
@@ -147,13 +150,17 @@ export default {
 				console.log('++++++++++++获取用户信息++++++++++++++++++',res)
 				uni.setStorageSync('userInfo',res.data.data)
 				this.userInfo = res.data.data
+				if (this.userInfo.selfPhoto){
+					this.getImgUrlByOssId(this.userInfo.selfPhoto)
+				}
 			})
 
 		},
 
 		getImgUrlByOssId(Id){
-			this.$api.getImgUrlByOssId(Id).then(res=>{
+			this.$api.getImage(Id).then(res=>{
 				this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+				this.$set(this.userInfo)
 			});
 		},
 		//头像上传

+ 1 - 0
pages/my/index.vue

@@ -161,6 +161,7 @@ export default {
 		  if (Id) {
         this.$api.getImage(Id).then(res=>{
           this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+			this.$set(this.userInfo)
         });
       }
 		},