邓洁 : 获取个人信息接口
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user