微信网站应用开发
開發(fā)條件:
1.注冊一個(gè)微信開放平臺(tái)的賬號
2.擁有一個(gè)已經(jīng)審核過的網(wǎng)站應(yīng)用。(才能獲得appid, appsecret)
當(dāng)網(wǎng)站審核過后,在瀏覽器輸入:
https://open.weixin.qq.com/connect/qrconnect?appid=APPID&redirect_uri=(網(wǎng)站的地址)&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect
scope=?snsapi_login 寫這個(gè)就行。
redirect_uri = 你得網(wǎng)站地址
這一步是獲得code。
下一步就是根據(jù)code+appid+AppSecret 換取?access_token
https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=AppSecret?&code=CODE&grant_type=authorization_code
grant_type=authorization_code 寫這個(gè)就行。
返回出:
{?
"access_token":"ACCESS_TOKEN",?
"expires_in":7200,?
"refresh_token":"REFRESH_TOKEN",
"openid":"OPENID",?
"scope":"SCOPE","unionid": "o6_bmasdasdsad6_2sgVt7hMZOPfL"}
最后就是根據(jù)access_id + open_id ?獲得yhud 基本信息。
總結(jié)
- 上一篇: 重磅!新职业技能证书来了,让你高薪就业
- 下一篇: 子网掩码、IP地址数、掩码长度对照表