获取用户基本信息?

小程序 文章 2022-01-06 11:20 252 0 全屏看文

AI助手支持GPT4.0

获取用户基本信息?Get basic user information?

获取用户基本信息?

现在官方通过了几次的完善,对API也进行了更新,例如,获取用户的基本信息用getuserinfo就不行了,有谁能帮下我嘛

Now the official has improved several times and updated the API. For example, getting the basic information of users can't be done with getUserInfo. Who can help me

回答:

社区技术运营专员-horanzhou:

wx.getUserProfile(Object object)

请查看:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html

余温无痕:

可以先在onLoad里执行code,然后通过后台返回个是否授权的状态,提示用户去主动触发wx.getUserProfile,不能默认执行wx.getUserProfile这个方法

Y.:我没有弄按钮得点击事件,直接写函数可以嘛,这代码有点多啊
余温无痕:得要有可点击事件去触发的,
甘:

getUserProfile


Y.:具体代码是啥,怎么直接在onload里面调用嘞
,就是现在授权弹窗都不弹了
brave:看文档啊,下面有
Y.:我看不懂……

-EOF-

AI助手支持GPT4.0