收藏
回答

微信授权获取用户信息报-12001,invalid scope?

"authorize:fail 系统错误,错误码:-12001,invalid scope"

	        wx.getSetting({
	          success(res) {    	          	 
	            if (!res.authSetting['scope.userInfo']) {//未授权getUserInfo            	
	              wx.authorize({
						scope: 'scope.getUserInfo',
						success(res) {	                
						// 用户已经同意小程序使用用户信息,后续调用 wx.userInfo 接口不会弹窗询问       
							wx.getUserInfo({
								success(res) {
									self.loginOk(res);
								},
								fail(err) {
								console.log(err)
								}
							})
						},
						fail(err){
							console.log(err)
						}
				 	})
回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-06-17

    2020-06-17
    有用
    回复 4
    • 沐雙惜
      沐雙惜
      2020-06-17
      您好,我的问题出现在每次清除授权信息后,刚进入就提示这个,但点击按钮后其它的正常


      {errMsg: "authorize:fail 系统错误,错误码:-12007,scope unauthorized"}


      代码:
      2020-06-17
      回复
    • Mr.Zhao
      Mr.Zhao
      2020-06-17回复沐雙惜
      你问题不是 “invalid scope”? 而且现在这个报错,也不算问题啊
      2020-06-17
      回复
    • 沐雙惜
      沐雙惜
      2020-06-17回复Mr.Zhao
      刚才看到您的第一次回复,修改了获取信息的scope,所以现在合法了,但又有这个错误提示,看着控制台打印的提示不舒服,哈哈,谢谢您
      2020-06-17
      回复
    • -
      -
      2021-04-06回复沐雙惜
      兄弟,问题解决了吗
      2021-04-06
      回复
登录 后发表内容
问题标签