第一个关于wx.getUserInfo的问题:
代码如下:
但是返回的用户信息根本不是我的信息,如下 :
假如调整一下代码,如下 :
返回'未授权',如下 :
我之前是授权过的,可能后来又拒绝了,不知道这是怎么回事?
第二个问题:就是在button中用openSetting,没有用户信息授权选项,难道拒绝一次,终身不能再用了吗???,代码如下:
打开页面:
打开页面后,却没有再次获取用户信息授权的选项,怎么办??????:
wx.getUserInfo返回问题? 和wx.openSetting问题....?wx.getUserInfo returns a problem? and wx.openSetting problem...?
wx.getUserInfo返回问题? 和wx.openSetting问题....?第一个关于wx.getUserInfo的问题:
代码如下:
但是返回的用户信息根本不是我的信息,如下 :
假如调整一下代码,如下 :
返回'未授权',如下 :
我之前是授权过的,可能后来又拒绝了,不知道这是怎么回事?
第二个问题:就是在button中用openSetting,没有用户信息授权选项,难道拒绝一次,终身不能再用了吗???,代码如下:
打开页面:
打开页面后,却没有再次获取用户信息授权的选项,怎么办??????:
The first one is about wx.getUserInfo Question: the code is as follows: but the returned user information is not my information at all, as follows: if you adjust the code, as follows: return 'unauthorized', as follows: I have authorized before, but may later refuse, I don't know what's the matter? Second question: open setting is used in button, and there is no user information authorization option, Can you refuse once and never use it again? The code is as follows: open the page: after opening the page, you don't have the option to obtain user information authorization again. What should you do
回答:
周知:getUserInfo 开发版 & 体验版 已对齐 getUserInfo 匿名表现,正式版将于 4月13日 正式对齐 getUserInfo 匿名表现。请开发者使用 getUserProfile 获取用户信息。
小程序登录、用户信息相关接口调整说明:https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801
用 getUserProfile
需要提前更新成 getUserProfile
线上要到4月13日才会完全改成新的,但是现在的开发环境包括IDE工具已经更新成新的方案。
如果你当心到时候无法顺利切换,可以使用 wx.canIUse
这个方法来判断 getUserProfile 来做切换