微信小程序即将不再支持wx.getUserInfo()

写小程序时候想获取用户信息的时候发现微信小程序已经不支持wx.getUserInfo()
有两种替代方案

一种是open-data标签
例如

<open-data type=“groupName” open-gid=“xxxxxx”>
<open-data type=“userAvatarUrl”>
<open-data type=“userGender” lang=“zh_CN”>
详细跳转 open-data

另一种是通过按钮的方式 buttonopen-type属性设置为getUserInfo

用于获取用户信息,可以从bindgetuserinfo回调中获取到用户信息
详细跳转 button

随手记录,有补充欢迎骚扰。

全部评论

相关推荐

05-23 20:31
已编辑
武汉大学 Java
内向的柠檬精在研究求职打法:注意把武大标粗标大 本地你俩不是乱杀
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客企业服务