对于不支持getUserProfile,采用getUserInfo获取用户头像仍然返回匿名数据?

小程序 文章 2021-04-05 15:02 588 0 全屏看文

AI助手支持GPT4.0

对于不支持getUserProfile,采用getUserInfo获取用户头像仍然返回匿名数据?If getUserProfile is not supported, using getUserInfo to get the user profile picture still returns anonymous data?

对于不支持getUserProfile,采用getUserInfo获取用户头像仍然返回匿名数据?

如图所示,我使用低版本的基础库调试时,采用getUserInfo接口来获取用户头像但仍然返回匿名数据?官方对此没有任何解决方案吗?意思是那些长期不更新微信的人我们得不到头像昵称了吗?

As shown in the figure, when I debug with a lower version of the basic library, I use the getUserInfo interface to get the user's Avatar, but still return anonymous data? Is there no official solution to this? Does it mean that for those who don't update wechat for a long time, we can't get the nickname of avatar?

回答:

詹迪克:


我看你代码里模拟的是2.10.4 ; 新接口2.10.4已经支持了 所以 getUserInfo 应该是返回匿名数据的。


可以2.10.3及以下的版本试试看?

BaoSaRenGaoWa:你愿意我一些皮肤吗?他太感谢你了
|G.XIAO|:

周知:getUserInfo 开发版 & 体验版 已对齐 getUserInfo 匿名表现,正式版将于 4月13日 正式对齐 getUserInfo 匿名表现。请开发者使用 getUserProfile 获取用户信息。

小程序登录、用户信息相关接口调整说明:https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801

另外,使用 wx.login 拿到code,去服务器换取 openId



常规问题,社区都有答案,学会搜索;如有帮助,点个赞或有用,谢谢


小李哥:恐怕您没有理解我的问题,我指的是那些不支持getUserProfile这个API的终端,请看一下我这边的代码。不支持getUserProfile才会使用getUserInfo
小李哥:或者说微信对于getUserInfo这个API返回内容始终是匿名了吗?
|G.XIAO|:不支持的,用  getUserInfo 获取用户昵称和头像
|G.XIAO|:你这个是在 开发版 & 体验版 的表现吧
小李哥:我正式版也有这个表现,已经上线运营的也有匿名数据,不然我也不会来社区提问了。现在才5号,公告说的是13号正式版才返匿名
|G.XIAO|:我试了一下我们的小程序,体验版没有头像,正式版是有的,基础库版本是2.14.4

-EOF-

AI助手支持GPT4.0