1. 程式人生 > 其它 >wx.authorize失效,錯誤碼為12006

wx.authorize失效,錯誤碼為12006

touchstart() {
                wx.getSetting({
                    success(res) {
                        if (!res.authSetting['scope.record']) {
                            wx.authorize({
                                scope: 'scope.record',
                                success() {// 使用者已經同意小程式使用錄音功能,後續呼叫 wx.startRecord 介面不會彈窗詢問
wx.startRecord({ success(res) { const tempFilePath = res.tempFilePath console.log(tempFilePath, '檔案') } }) }, fail(error) { console.log(error,
'獲取錄音授權失敗!') } }) } } }) },

先說一下出現這個情況的原因,第一次拒絕授權之後,後面在拉取錄音的許可權時就沒有反應了,錯誤碼為12006


要麼清除小程式快取,要麼提示使用者手動到設定裡面開啟許可權