getUserInfo:fail api scope is not declared in the privacy agreement“, errno: 112
时间: 2023-11-17 08:01:49 浏览: 112
getUserInfo:fail api scope is not declared in the privacy agreement“, errno: 112是因为在调用wx.getUserInfo()时,没有在小程序管理后台的“开发-接口设置”中添加“用户信息”,导致权限不足而报错。解决方法是在小程序管理后台的“开发-接口设置”中添加“用户信息”权限即可。
相关问题
getUserInfo:fail api scope is not declared in the privacy agreement
当调用wx.getUserProfile进行授权时,返回错误信息"getUserProfile:fail api scope is not declared in the privacy agreement"表示在隐私协议中未声明相关的权限范围。为了解决这个问题,你需要在执行wx.getUserProfile之前先调用uni.openPrivacyContract函数进行隐私协议的打开操作,以确保已声明了所需的权限范围。此外,你还可以增加一个弹窗来引导用户阅读小程序的隐私保护指引。在用户确认阅读并同意后,再调用wx.getUserProfile获取用户信息即可。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [{errMsg: “getUserProfile:fail api scope is not declared in the privacy agreement“, errno: 112}](https://blog.csdn.net/qq_38839887/article/details/132317169)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
"getUserInfo:fail api scope is not declared in the privacy agreement"
引用内容中提到的错误信息 "getUserInfo:fail api scope is not declared in the privacy agreement" 是因为微信小程序登录增加了用户是否查看隐私协议的验证,如果用户没有查看隐私协议,就不允许获取用户信息。因此,需要在小程序中添加隐私协议并引导用户查看同意后才能获取用户信息。
阅读全文