wx.getUserInfo({
success: function(user) {
wx.hideLoading();
_this.data.isLoading = false;
user.userInfo.avatarUrl = user.userInfo.avatarUrl || app.data.defaultHead;
app.data.userInfo = user.userInfo;
app.data.currNick = user.userInfo.nickName;
app.data.currHead = user.userInfo.avatarUrl;
console.log(user.userInfo); # 真机调试模式下会显示avatarUrl属性,但头像未显示
_this.setData({
isLogin: true,
currNick: user.userInfo.nickName,
currHead: user.userInfo.avatarUrl
});
})
})