https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html
通过code换取网页授权access_token
Code: 041cQ8ll2nWy5c42enol2R2DZX2cQ8ly
响应:
{
"access_token":"73_NSpWjmw0mXLvwFwYA8J8iJXECda9jWN3U1wb79_u8D2d1qLDYlQT0QBsCbop2-2w-m09pOSBtl3F5xkj4zmBtytllbcuc6GxWgRch4YIHHI",
"refresh_token":"73_ThqPeIUCpRtrNx0GRf6e87z3rdXmjIKe44uxwEBiBJhE6140GQDYkzSL3dtRnHvPK91w_VHY3UkONqAr5fsB2znIeHQy6plnpL6LLoRT4hQ",
"openid":"on_I362w6EIVWnpo4ttq7i5-Sc9s",
"scope":"snsapi_userinfo",
"expires_in":7200
}
拉取用户信息
响应:
{
"country":"",
"province":"",
"city":"",
"openid":"on_I362w6EIVWnpo4ttq7i5-Sc9s",
"sex":0,
"nickname":"æ²\u0089è¿·å¦ä¹ ",
"headimgurl":"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXLMv85Sk2x0MxR9aPOIC9QxWJT5NiasiaoomDPg5BcNuQoicOQwlSY0bw2drjrBmmZt9TyEa7h3yQw/132",
"language":"",
"privilege":[
]
}
只有开放平台才能获取到
说明接口请求的appid没有绑定开放平台