wx.getSetting已经授权过,无法获取授权
- 当前 Bug 的表现(可附上截图)
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
授权过res.authSetting['scope.userInfo']为false
wx.getSetting({
success: (res) => {
console.log(res.authSetting);
if (res.authSetting['scope.userInfo']) { //
if (mpvue.getStorageSync('wxUserInfo')) {
that.needUserInfo = 1;
that.login();
} else {
wx.getUserInfo({
success: (res) => {
mpvue.setStorageSync('wxUserInfo', res.userInfo);
that.needUserInfo = 1;
that.login();
}
});
}
} else {
console.log('没有token');
// 无用户权限先让授权
that.needUserInfo = 0;
}
}
});
2 回复
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)