ソースを参照

refactor:用户信息修改

zhanghui 2 年 前
コミット
2ac8183a3c
3 ファイル変更14 行追加6 行削除
  1. 2 2
      myPages/realNameAuth/index.vue
  2. 11 4
      myPages/userInfo/index.vue
  3. 1 0
      pages/my/index.vue

+ 2 - 2
myPages/realNameAuth/index.vue

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

+ 11 - 4
myPages/userInfo/index.vue

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