邓洁 : 获取个人信息接口

This commit is contained in:
dengj
2023-11-17 10:53:17 +08:00
parent b23e7c848c
commit 0c1998d09e
2 changed files with 8 additions and 11 deletions

View File

@@ -25,7 +25,7 @@
data() {
return {
Info: {
avatar: [],
avatar: '',
username: '',
avatarUrl: ''
}
@@ -36,10 +36,9 @@
getUserInfo() {
this.$api.getUser().then(res => {
const data = res.data.data
console.log('头像昵称', res);
if (data) {
this.avatar = this.$api.imgUrl + data.avatar
this.avatarUrl = '/' + data.avatar
this.Info.avatar = this.$api.imgUrl + data.avatar
this.avatarUrl = data.avatar
this.Info.username = data.nickname
}
}).finally(_ => {})
@@ -98,8 +97,6 @@
},
onLoad() {
let that = this
this.$data.Info.username = wx.getStorageSync('nickname')
this.$data.Info.avatar = wx.getStorageSync('avatar')
this.getUserInfo()
}
}