微信網(wǎng)頁授權(quán)登錄
時(shí)間:2022-08-06 19:21:01 | 來源:網(wǎng)站運(yùn)營(yíng)
時(shí)間:2022-08-06 19:21:01 來源:網(wǎng)站運(yùn)營(yíng)
1.授權(quán)地址 參數(shù) appid redirect_url(配置好的網(wǎng)頁地址 小程序地址)
https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${local}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect
授權(quán)成功以后 會(huì)跳到網(wǎng)頁地址后邊帶code參數(shù) 將此參數(shù)傳給后端
2.參數(shù) appid code appsecret 獲取獲取網(wǎng)頁授權(quán)acess
token 和open_id 調(diào)用的API
https://api.weixin.qq.com/sns/oauth2/access_token?grant_type=authorization_code&appid=%s&secret=%s&code=%s3.參數(shù) open_id acesstoken 獲取用戶信息 調(diào)用的API
https://api.weixin.qq.com/sns/userinfo?lang=zh_CN&access_token=%s&openid=%s獲取到用戶信息以后剩下的就看自己操作了 如果那寫錯(cuò)啦 請(qǐng)指正 當(dāng)前為學(xué)習(xí)筆記