uniapp小程序授权拒绝后,再次打开提示。
这里以摄像头权限为例:onShow() {uni.authorize({scope:'scope.camera',success: (res) => {console.log('11111');},fail: (res) => {uni.showModal({content:'检测到您没打开摄像头权限,是否去设置打开?',confirmText: "确认",cancelText:'取消
·
这里以摄像头权限为例:
onShow() {
uni.authorize({
scope:'scope.camera',
success: (res) => {
console.log('11111');
},
fail: (res) => {
uni.showModal({
content:'检测到您没打开摄像头权限,是否去设置打开?',
confirmText: "确认",
cancelText:'取消',
success: (res) => {
if(res.confirm){
uni.openSetting({
success: (res) => {
console.log(res);
}
})
}else{
uni.navigateBack({
delta:1
})
}
}
})
}
})
}
更多推荐
已为社区贡献2条内容
所有评论(0)