微信分享流程

来源:互联网 发布:深度os和ubuntu哪个好 编辑:程序博客网 时间:2024/04/30 23:46

1,流程:

使用的AppId和AppSecret在开发者中心-开发者ID

进入微信公众平台后台后,依次进入开发者中心-权限表,找到网页授权获取用户基本信息

1)用户授权登录,获取code

https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect

2)通过code获取access_token

https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code

3)通过access_token获取用户信息

https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID
0 0
原创粉丝点击