微信getsetting
发布于 7 年前 作者 uyin 4763 次浏览 来自 问答
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scopewx.getSetting({
    success(res) {        if (!res.authSetting['scope.record']) {
            wx.authorize({
                scope: 'scope.record',
                success() {                    // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                    wx.startRecord()
                }
            })
        }
    }
})

这个接口不弹窗了,不知为什么

3 回复

你好,请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

不好意思,我知道什么问题了,当用户拒绝授权后,短期内不再弹出授权窗口。

回到顶部