邓洁 : 获取个人信息接口

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

@@ -56,9 +56,6 @@
return
}
this.isLoad = true
// this.$data.account = wx.getStorageSync('account')
// this.$data.username = wx.getStorageSync('nickname')
this.getInfo()
},
methods: {
reOnLoad() {
@@ -68,6 +65,9 @@
return
}
this.isLoad = true
if(this.isLoad){
this.getInfo()
}
},
failToLoad() {
uni.reLaunch({
@@ -97,11 +97,11 @@
//---------页面调用接口示例------------
getInfo() {
this.$api.getUser().then(res => {
console.log('userInfo', res);
var data = res.data.data
if (data) {
this.src = uni.getStorageSync('img_url') + data.avatar
this.src = this.$api.imgUrl + data.avatar
this.username = data.nickname
this.account = data.sn
}
})
}