微信小程序即将不再支持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

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

全部评论

相关推荐

牛客84809583...:举报了
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务