麦克风授权失败问题
checkCameraAndRecord() {
wx.getSetting({
success(res) {
let that = this
const userInfo = res.authSetting['scope.userInfo'] || false;
const cameraAuthorized = res.authSetting['scope.camera'] || false;
const recordAuthorized = res.authSetting['scope.record'] || false;
console.log('userInfo====' + userInfo);
console.log('cameraAuthorized=====' + cameraAuthorized);
console.log('recordAuthorized=======' + recordAuthorized);
if (!recordAuthorized) {
wx.authorize({
scope: 'scope.record',
success() {
console.log('录音授权成功');
},
fail(err) {
console.log('录音授权失败');
console.log(err);
wx.showModal({
title: '提示',
content: '请手动开启录音权限',
confirmText: '去设置',
success(modalRes) {
if (modalRes.confirm) {
wx.openSetting({ // 打开小程序设置页面
success(settingRes) {
console.log(settingRes);
}
});
}
}
})
}
})
}
}
})
}
d打开程序设置页面,根本不显示麦克风,有时候显示有时候不显示(不显示的时候居多),但是我再次重启小程序后,她就会出现麦克风授权的弹窗,是为什么?