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

微信接口变化了:用户unionID获取策略调整 #37

Open
hyqHualai opened this issue Dec 18, 2017 · 0 comments
Open

微信接口变化了:用户unionID获取策略调整 #37

hyqHualai opened this issue Dec 18, 2017 · 0 comments

Comments

@hyqHualai
Copy link

用户unionID获取策略调整,请开发者注意更新
为保护用户隐私,用户unionID需用户主动授权或关注公众号后才可获得,微信公众号接口将做以下调整:

1、微信授权登录功能中的换取access_token接口

https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
本接口在scope参数为snsapi_base时不再提供unionID字段。

调整建议:

只需将scope参数修改为snsapi_userinfo即可重新获得用户unionID。

详情可参考微信授权登录文档

2、获取用户基本信息接口

https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN
https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token=ACCESS_TOKEN
本接口在用户未关注公众号时,将不返回用户unionID信息。

调整建议:

已关注的用户,开发者可使用“获取用户基本信息接口”获取unionID;

未关注用户,开发者可使用“微信授权登录接口”并将scope参数设置为snsapi_userinfo,获取用户unionID

详情可参考获取用户基本信息接口文档

以上变更将在2017年12月31日之前逐步生效,请开发者尽快更新。​

微信团队
2017年12月13日

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant