wx.authorize(Object object)调用不弹授权弹框,直接失败了?
发布于 7 年前 作者 guochao 3812 次浏览 来自 官方Issues
wx.authorize({
              scope: "scope.userInfo",
              success() {
                console.log("scope.userInfo32")
                // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                wx.getUserInfo({
                  success: res => {
                    console.log(res);
                  },
                  fail: error => {
                    console.log(error);
                  },
                  complete: result => {}
                });
              },
              fail(e) {
                console.log("scope.userInfo error", e);
              }
            });

直接这样调用授权, 走了fail, 错误信息如下  authorize:fail 系统错误,错误码:-12007,scope unauthorized

照着文档写的,不知道哪里写错了, 请赐教。十万火急, I’m dying.

回到顶部