Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序更新wx.getUserProfile,无法获取到小程序用户信息 #2069

Closed
maple2012 opened this issue Apr 6, 2021 · 12 comments
Closed

Comments

@maple2012
Copy link

微信小程序更新了。wx.getUserProfile(Object object)。
后端在使用wxMaService.getUserService().getUserInfo获取不到用户的 openid和 union了。

@TerryGuan

This comment has been minimized.

@junjiex123

This comment has been minimized.

@binarywang

This comment has been minimized.

@junjiex123
Copy link

@binarywang
image

@binarywang

This comment has been minimized.

@binarywang
Copy link
Owner

按照官方文档描述,接口不需要调整,只是数据变了而已

@rpdict
Copy link

rpdict commented Apr 8, 2021

同样的问题,感觉是加密encryptedData的时候没包含openid,所以解密出来也没有openid。。

@TerryGuan
Copy link

1、wx.login拿到code,服务端换openid,unionid,本地记录登陆的token
2、wx.getUserProfile拿到的encryptedData,iv值里面比之前是少了openid,unionid的,只有头像和昵称。。。
3、通过之前登陆的token获取当前登陆的openid更新头像和昵称

@rpdict
Copy link

rpdict commented Apr 9, 2021

1、wx.login拿到code,服务端换openid,unionid,本地记录登陆的token
2、wx.getUserProfile拿到的encryptedData,iv值里面比之前是少了openid,unionid的,只有头像和昵称。。。
3、通过之前登陆的token获取当前登陆的openid更新头像和昵称

是的,现在要拉个人信息要像之前获取手机号一样写了,先用userInfo获取openid,再用userProfile获取详情更新上去。
官方示例代码不推荐使用getUserInfo获取用户信息,我这边好多同事都理解成getUserInfo废弃了,这是不对的。

@PanPanda
Copy link

1、wx.login拿到code,服务端换openid,unionid,本地记录登陆的token
2、wx.getUserProfile拿到的encryptedData,iv值里面比之前是少了openid,unionid的,只有头像和昵称。。。
3、通过之前登陆的token获取当前登陆的openid更新头像和昵称

是的,现在要拉个人信息要像之前获取手机号一样写了,先用userInfo获取openid,再用userProfile获取详情更新上去。
官方示例代码不推荐使用getUserInfo获取用户信息,我这边好多同事都理解成getUserInfo废弃了,这是不对的。

getUserInfo获取用户信息现在nickname做了处理拿不到用户的昵称了

@binarywang binarywang pinned this issue Apr 19, 2021
@binarywang binarywang changed the title 微信小程序更新了。wx.getUserProfile(Object object)。获取不到小程序用户信息了 微信小程序更新wx.getUserProfile,无法获取到小程序用户信息 Apr 19, 2021
@gongming1982

This comment has been minimized.

@binarywang

This comment has been minimized.

Repository owner locked as too heated and limited conversation to collaborators Jun 1, 2021
@binarywang binarywang unpinned this issue Aug 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants