wx.getSetting线上版本没反应,开发和体验版本完全OK
发布于 7 年前 作者 xuchao 7391 次浏览 来自 问答

调起录音

弹出授权窗口

点击拒绝

使用wx.getSetting,wx.authorize进行二次授权,按钮点击无反应

2 回复

报错信息是什么?

没有任何报错信息。

代码逻辑如下:

wx.getSetting({

success(settings) {

console.log(‘获取授权信息:’, settings)

       if (settings && !settings.authSetting[‘scope.record’]) {

wx.authorize({

scope: ‘scope.record’,

success() {

                    RecorderManager = wx.getRecorderManager()

                    backgroundAudioManager.title = ‘录制我的跨年演讲’

                    backgroundAudioManager.src = `${ResourcesBaseUrl}MTU0NDY5NDUyMjgw.mp3`

                    that.RecorderManagerWatch()

                },

                fail() {

                    console.log(‘询问失败’)

                    wx.openSetting({

                        success(open) {

                            if (!open.authSetting[‘scope.record’]) return false

                        }

                    })

                }

            })

        } else {

            RecorderManager = wx.getRecorderManager()

            backgroundAudioManager.title = ‘录制我的跨年演讲’

            backgroundAudioManager.src = `${ResourcesBaseUrl}MTU0NDY5NDUyMjgw.mp3`

            that.RecorderManagerWatch()

        }

    }

})

回到顶部