WX小程序获取用户信息失败getUserInfo:failscopeunauthorized
在更改小程序 APPID 等信息后,原来的获取用户信息功能失败
wx.getUserInfo({ success: function (res) { console.log('获取用户信息成功') self.setData({ thumb: res.userInfo.avatarUrl, nickname: res.userInfo.nickName }) }, fail: function(res){ console.log('获取用户信息失败') console.log(res) }在fail 中输出错误信息
得到 getUserInfo:fail scope unauthorized
解决方案,在页面添加授权按钮
button open-type='getUserInfo' 获取授权/button进行手动授权
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

