wx book 微信 请求 详情
processon流程图
通过微信api获取code
通过微信api获取code 请求
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1bc19552cdf88ce0&redirect_uri=http%3a%2f%2fwww.rosellete.com%2fweixinoauth.php&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect
通过微信api获取code 返回
081HSqIj23RIdG0dEuHj21U0Ij2HSqIC
通过微信api获取openid和access_token
通过微信api获取openid和access_token 请求
https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx1bc19552cdf88ce0&secret=15e342bff2738aef8bbf6f70aebf4e78&code=081HSqIj23RIdG0dEuHj21U0Ij2HSqIC&grant_type=authorization_code
通过微信api获取openid和access_token 返回
{
"access_token": "14_0p4bbgwYGoyQh7TEBM8uL_H4mEkIMyhIj0isUOoSmAH7G38f4S43BH-4i4U-IU7qn2DdabeCEwF-ZqYmTkPvkI9_nntH95icxjAirT2CDK0",
"expires_in": 7200,
"refresh_token": "14_43T9kSE-FUiJ-fzaVBFK7RizZ358cHVP8_WslvvxkiA5E4Q7uyC4PAVDRdeoq1tlfED5KJ34wwOOeYQjmnKiA_u2Dzr7doESOV25Pqqf2cc",
"openid": "oUUmn1PwWsuVsYiNWl-nBTD4U8jY",
"scope": "snsapi_userinfo"
}
通过openid和access_token获取用户信息
通过openid和access_token获取用户信息 请求
https://api.weixin.qq.com/sns/userinfo?access_token=14_0p4bbgwYGoyQh7TEBM8uL_H4mEkIMyhIj0isUOoSmAH7G38f4S43BH-4i4U-IU7qn2DdabeCEwF-ZqYmTkPvkI9_nntH95icxjAirT2CDK0&openid=oUUmn1PwWsuVsYiNWl-nBTD4U8jY
通过openid和access_token获取用户信息 返回
{
"openid": "oUUmn1PwWsuVsYiNWl-nBTD4U8jY",
"nickname": "金墨痴",
"sex": 1,
"language": "zh_CN",
"city": "Hangzhou",
"province": "Zhejiang",
"country": "CN",
"headimgurl": "http://thirdwx.qlogo.cn/mmopen/vi_32/jMCUwXNfCJdycmAy7eItdFpSMFBZoQSDbrZZd7ic21smh8dJsNau1tjIPMHbmkqeK6hK70Skzfx20E2ZTT3ZBGQ/132",
"privilege": []
}
部分参考
简单的实现微信获取openid==>https://blog.csdn.net/z880698223/article/details/78485243
感觉空虚寂寞,只是因为你无所关注,无处付出。