Merge pull request 'dengjie : 解决单独修改昵称,头像保存问题' (#87) from dengjie into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/87
This commit is contained in:
odjbin
2023-02-04 16:10:33 +00:00

View File

@@ -3,7 +3,6 @@
<view class="change_avatar"> <view class="change_avatar">
<u-avatar :src="avatar" size="140rpx" shape="circle" @click="changeAvatar()"></u-avatar> <u-avatar :src="avatar" size="140rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view> </view>
<view> <view>
<u--form labelPosition="left" :model="model"> <u--form labelPosition="left" :model="model">
<u-form-item label="修改昵称" prop="userInfo.name" borderBottom> <u-form-item label="修改昵称" prop="userInfo.name" borderBottom>
@@ -42,6 +41,7 @@
this.$apiServe.getUser().then(res => { this.$apiServe.getUser().then(res => {
var data = res.data.data var data = res.data.data
this.avatar = uni.getStorageSync('img_url') + data.avatar this.avatar = uni.getStorageSync('img_url') + data.avatar
this.avatarUrl = '/' + data.avatar
this.model.userInfo.name = data.nickname this.model.userInfo.name = data.nickname
}).finally(_ => {}) }).finally(_ => {})
}, },
@@ -74,7 +74,6 @@
const result = this.updatePromise(res.tempFilePaths[0]) //上传图片 const result = this.updatePromise(res.tempFilePaths[0]) //上传图片
result.then(value => { result.then(value => {
this.avatarUrl = '/' + value this.avatarUrl = '/' + value
console.log(this.avatarUrl);
}) })
} }
} }