getusername: function(){
var that = this
wx.getUserInfo({
success: function(res) {
console.log('success',res)
that.setData({
name:res.userInfo.nickName,
path:res.userInfo.avatarUrl
});
},
fail:function(res){
console.log('fail')
}
})
},
获取用户信息用新接口了,旧的已经不返回真实用户昵称和头像了。
https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html
还有我的二维码预览永远失效 v1.05