2.前面请求成功后 会在跳转url后得到

?code=00b788e3b42043c8459a57a8d8ab5d9f&state=1


3.之后

使用code换取access_token

换取网页授权access_token页面的构造方式:

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

参数说明

参数 是否必须 说明
appid 公众号的唯一标识
secret 公众号的appsecret
code 填写第一步获取的code参数
grant_type 填写为authorization_code

code:在这里填写为上一步获得的值

构造请求url如下:

https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx8888888888888888&secret=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&code=00b788e3b42043c8459a57a8d8ab5d9f&grant_type=authorization_code

相关文章:

  • 2021-06-26
  • 2022-12-23
  • 2021-08-17
  • 2021-07-24
  • 2021-11-21
猜你喜欢
  • 2021-07-31
  • 2021-12-20
  • 2021-05-23
  • 2022-12-23
  • 2021-05-12
  • 2022-01-10
相关资源
相似解决方案