调用wx.getUserProfile()真机调试其他用户不弹窗
时间: 2023-11-27 12:09:43 浏览: 176
调用wx.getUserProfile()在真机调试时,如果其他用户没有弹窗,可能是因为用户之前已经授权过该小程序获取用户信息的权限,所以在之后调用wx.getUserProfile()时就不会再弹窗询问用户是否授权。这种情况下,可以直接获取到用户信息,但头像会显示为灰色,昵称为"微信用户"。这是因为用户之前已经授权过,但是没有选择提供头像和昵称信息。如果你希望在真机调试时弹出授权弹窗,可以在代码中手动添加一个权限弹窗,让用户重新确认授权。可以参考你提供的代码中的signupAndLogin()方法,在用户未授权时手动弹出授权弹窗,再调用wx.getUserProfile()获取用户信息。这样就能确保在真机调试时弹出授权弹窗了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [如何解决发布后调wx.getUserProfile调不起来授权弹窗?](https://blog.csdn.net/doctorjinshui/article/details/128267529)[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: 50%"]
- *2* *3* [wx.getUserProfile 不出现弹窗](https://blog.csdn.net/Ice1774/article/details/129542888)[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: 50%"]
[ .reference_list ]
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)