微信小程序授权拒绝后就不弹出授权窗了?
授权页面代码如下
Page({
onLaunch:function(){
},
onShow: function () {
wx.setNavigationBarTitle({
title: '授权'
})
},
authorizeInfo: function () {
wx.authorize({
scope: 'scope.userInfo',
success() {
wx.switchTab({
url: '/pages/index/index',
})
}, fail(res) {
wx.openSetting({
success: (res) => {
// if (!res.authSetting["scope.userInfo"]) {
// res.authSetting = {
// "scope.userInfo": true
// }
// }
if (res.authSetting["scope.userInfo"]) {
wx.switchTab({
url: '/pages/index/index',
})
}
}
})
}
})
}
});
微信小程序开发问题解答
微信小程序开发者回答:
opensetting打开授权列表,引导用户点击允许获取信息
本文网址:http://www.91bianli.com/weixinxiaochengxu/21073.html