wx.getSetting({
success (res) {
let recordAuth = res.miniprogramAuthSetting['scope.record']
console.log('是否授权录音')
console.log(res)
console.log(recordAuth)
if (recordAuth) {
self.startRecord()
} else { // 第一次进来,未发起授权
wx.authorizeForMiniProgram({
scope: 'scope.record',
success () {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 2000
})
},
fail (error) {
console.log('authorizeForMiniProgram fail')
console.log(error)
wx.showToast('error', '鉴权失败,请重试')
}
})
}
},
fail (error) {
console.log('getSetting fail')
console.log(error)
wx.showToast('error', '鉴权失败,请重试')
}
})
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。