微信公开课
如何看待微信公开课小程序热门讨论「小程序官方文档api例子错误」
摘要:小程序官方文档api例子错误
展开://可以通过wx.getSetting先查询一下用户是否授权了scope.record这个scopewx.getSetting({success(res){if(!res[scope.record]){wx.authorize({scope:scope.record,success(){//用户已经同意小程序使用录音功能,后续调用wx.startRecord接口不会弹窗询问wx.startRecord()}})}}})以上代码运行错误,res[scope.record]undefined正确运行代码:wx.getSetting({success(res){console.log(res);if(!res.authSetting[scope.userInfo]){gd.auths();}else{util.toPage(../chat/chat);}}});了解更多