kenshinobiy

clipboard.png
我想在一进入页面的时候就进行判断提示并且弹出提示授权!
请问该如何处理比较合理

wx.authorize({})

//可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
wx.getSetting({

success(res) {
    if (!res.authSetting[\'scope.record\']) {
        wx.authorize({
            scope: \'scope.record\',
            success() {
                // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                wx.startRecord()
            }
        })
    }
}

})

文档里有的 https://developers.weixin.qq.com/miniprogram/dev/api/authorize.html

 


 

微信小程序授权获取用户详细信息openid的实例详解

http://www.jb51.net/article/124132.htm

 

分类:

技术点:

相关文章:

  • 2021-12-27
  • 2022-01-07
  • 2021-09-24
  • 2021-12-16
  • 2022-02-08
  • 2021-12-30
  • 2022-12-23
猜你喜欢
  • 2021-06-07
  • 2021-07-04
  • 2021-07-05
  • 2021-07-13
  • 2021-11-19
  • 2021-05-21
  • 2021-08-23
相关资源
相似解决方案