微信小程序授权拒绝后就不弹出授权窗了?
微信小程序授权拒绝后就不弹出授权窗了?
授权页面代码如下
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’,
})
}
}
})
}
})
}
});