wx.authorize请求scope. userInfo返回错误12007 ?
发布于 7 年前 作者 aliang 4499 次浏览 来自 问答

想通过编程方式获取用户信息,找到小程序API:wx.getUserInfo

wx.getUserInfo,必须要先通过wx.authorize来得到权限才能不报错

wx.authorize请求scope.userInfo权限时,并不会弹出授权框而是直接失败了,返回的信息:

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

如果这种方案不行的话,微信小程序如何通过编程式弹出请求用户信息窗口?

3 回复

现在只能点按钮获取

<button open-type=‘getUserInfo’></button>

好吧,非常感谢~

回到顶部