WeChat ?? ??? ???? ?? ?? ??:
??? ??? ?? ??? ??? ????.
1 1??: ???? ?? ?? ? ??? ?????
2 2??: ???? ?? access_token ?? ??
3 3??: access_token ?? ??(??? ??)
4 4??: ??? ?? ????(snsapi_userinfo ??? ???)
1 ?? ??
WeChat ?? ??? ?? ??(?? ????)? ??? ??? ???? ????(??? ??? ?? ??????? ????? ?? ????? snsapi_base ? snsapi_userinfo? ????.
"??? ??? ? ????."?? ???? ???? ??? ?????. ????? ?? ?????? ?? ?? ????? ??? ??.
?? ?? ??: ?? ??? ?? ?? ???? ?? ?? ??? ??? ? WeChat? ??? ?????. ?? ??? ?? ???? ??? ?? ?? ??? ???? ??? ???? ??? ?? ???? ????? ???? ? ????.
??
AppID - ?? ??? ?? ???
REDIRECT_URI - ?? URL
SCOPE - ?? snsapi_base(?? ?? ?? ???? ?? ???? ???? openid? ?? ? ??) ?? snsapi_userinfo(?? ???? ???? openid? ?? ???, ??, ??? ?? ? ???, ???? ????? ???? ???? ???? ??? ?? ?? ????. )
STATE - ???? ???? ?? ?? ??? ? ????. a-zA-Z0-9
2 ???? ?? access_token ?? ??
???? ??? ???? ???? ?????.redirect_uri/?code=CODE&state=STATE? ?? .
state? ??? ??? STATE ???????.
?? ??:
<code class="hljs php">$code = I('get.code'); if (empty($code)) { //todo 非微信訪問 exit('</code>'); }else{ //授權(quán)后操作 }
??? ??? access_token? ?? ? ????. ??>??? ?? ? ?? ??? ???? access_token? ????.
appid - ?? ??? ?? ???
secret - ?code - ? ???? ??
grant_type - ?? Authorization_code
?? ??:
<code class="hljs bash">$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . C('wechat.AppID') . '&secret=' . C('wechat.AppSecret'); $str = file_get_contents($url); $str = json_decode($str, true); $access_token = $str['access_token'];</code>
???? access_token?
?? ???? TP ?????? ???? ?? ?? ??? ?? ???? ????? ? ????. ?:
<code class="hljs php">$access_token = S('access_token'); if (empty($access_token)) { $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . C('wechat.AppID') . '&secret=' . C('wechat.AppSecret'); $str = file_get_contents($url); $str = json_decode($str, true); $access_token = $str['access_token']; S('access_token', $access_token, 3600); }</code>
access_token? ?? ??? openid(???? ?? ???)? ?????. ?? WeChat ????? ??? ?? ?????. ???? ?? ???? ?? ??? ????? ?? ?????. ???? ?? ??? ????? ???? ?? ???? ?? ??? ??? OpenID? ?????.
openid? ???? ???? ????? ?? ?? WeChat ???? ???? ?????. ??? ??? openid? ?? ? openid? ?? ? ????.
??????? ???? ? openid? ???? ???? ??? ???? ??? ???? ?? ?? ??? ????. user_id ?? session, ?????? ?? ??? 3 3?? ???? ??? ? access_token? ?? ????
4 ??? ?? ????(??? ???) snsapi_userinfo)
??????? ? WeChat ID ??? ???? ??? ???? ?????. ?? ???? ? ??? ??? ?? ?? ? ?? ??? ????(??? ??? ??). , ? ??? ?? ??? snsapi_userinfo?? ???? ?? access_token ? openid? ?? ??? ??? ??? ? ????. ?? ?? ??????? ???? ???? ??????. ? WeChat ??
??(openid? ??)
access_token - ??? ?? access_token
openid - ?? ??? ?? ???<code class="hljs php">$url="https://api.weixin.qq.com/cgi-bin/user/info?access_token=$access_token&openid=$openid&lang=zh_CN"; $str = file_get_contents($url); $str = json_decode($str, true); if (empty($str['errcode'])) { //創(chuàng)建user并綁定 openid}else{ //錯誤處理}</code>
? ??? WeChat ?? ??? ?? ???? ??? ?? ?? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Scrapy? WeChat ?? ??? ?? ??? ? ??? ?????. WeChat? ?? ? ? ?? ?? ?? ?? ??? ????????, ??? ???? ?? ??? ?? ??? ??? ???. ?? ?? ?? ??? WeChat ?? ??? ??? ??? ?????. ???? ? ?? ??? ??, ??? ??? ? ?? ??? ??? ? ?? ?????. ? ??? ????, ???? ? ??? ???? ??? ??? ? ????. ??? ? ???? Scrapy ?????? ???? WeChat ?? ?? ?? ????? ???? ??? ???????. Scr

WeChat ?? ?? ??? ???? ???? ?? ??, ?? ??, ?? ??, ????? ?? ? ??? ??? ????. ??? ??: 1. ?? ?? ??? ?? ??? ??? V ??? ?? ?? ??? ?? ???. ? ??? ?? ??? ???? ??? ??? ???? ?? ?? ?? ??? ? ?? ??? ? ?? ????. 2. ?? ??. ??? ?? ??? ??? ?? ???? ? ?? ??? ??? ????. ?? ??, ??? ?? ??? ??? ?? ? ?? ?? ?? ?? WeChat ?? ??? ???? ? ????.

Python? ??? ??? ?? ? ? ??? ??? ?? ??? ????? ?????. ??? ??? ???? ??? ?? ???? ?? ? ???, ???? ???? ?? ??? ??? ?????. ??? ??? ?? ? ???? Python ???? ?? ?????. ? ????? Python ???? ???? WeChat ?? ?? ?? ??? ?? ??? ?????. WeChat ?? ??? ???? ??? ???? ?? ?? ?? ??? ????? ?? ??? ?? ???? ?? ? ???? ?? ??? ?????.

??? ??? ??? WeChat ?? ??? ?? ? ?? ??? ??? ??? ??? ?????. WeChat ?? ??? ? ?? ??? ????? ?? ?????? ???? ?? ??? ????. ? ????? PHP ??? ?? ?? WeChat ?? ?? API ?????? ???? ??? ?????. 1. ?? WeChat ?? ?? API ?????? ???? ?? ???? WeChat ?? ?? ??? ???? WeChat ?? ????? ??? ????? ??? ???? ???. ??? ????? ???? ?? ??? AppID ? AppSe? ?? ? ????.

Laravel? ???? WeChat ?? ??? ???? ??? ?? ???? ???? ?? WeChat ?? ??? ?? ???? ?? ?? ? ?? ??? ?? ??? ???? ??? ??? ???? ??????. ???? ???? WeChat ?? ??? ???? ? ??? ?? ???? ???? ??? ???? ??? ???? ? ????. ? ???? Laravel ?????? ???? ??? ???? ???? ??? ???? ???? ?? ??? ?????. ???? ?? ?? ?? ??? Laravel ?????? ???? ??? ???? ???. ???

?? ??? ??? ??? ??? ??? ? ?? ?? ??? ??? ?? 8?? ??? ??? ? ????. ?? ??? ???? ??: 1. ??? "?? ??"? ??? ? "? ??? ? ??? ??"? ?????. ? ?? ?? ??? ?????. 2. ? ?? ??? ??? ? ?? ? ?? ?? ??? ?? + ??? ???? "??? ???"? ???? ? ?? ??? ?????. 3. ?? ???? ???? ??? ? "??"? ?????. ???? ???'? ???? ?? ??? ??? ?????.

???? ??? ??? ??? ???? ???? ?? WeChat ?? ??? ?? ???? ???? ?? ??? ?????. WeChat ?? ??? ?? ??? ???? ?? ??????, ??? ???? ????, ??? ???? ?? ? ????. WeChat ?? ?? ??????? ? ? ???? ?? ?? ? ?? ???? ??? Go ??? ???? WeChat ?? ?? ??????? ????? ???? ????. Go ??? Google? ??? ????? ???, ??? ???? ???, ???? ??? ??? ??????? ???? ? ?????. ?? ??? ????

8? 1? ? ????? ??? ???, ?? ?? ??? ?? ??? ?? ??? ??????. ?????? ???? ??? ?? ??? ??? ??? ???? ?? ??, ??, ?? ? ?? ??? ??? ?? ??? ??? ???? ??? ????? ??????. ??? ??? ????? ??? ??????? ???? ??? ? ???? ?? ????. WeChat? ???? ??? ????, ?? ???? ???? ???? ?? ??? ?? ?? ??? ?? ????. ? ???? ??? ????? ??? ??? ??? ??, ??, ??, ?? ??? ???? ?? ??? ??? ???? ??? ???? ?? ????. ▲?? ?? ?? ?? ??? ????, ?? ?? ???? ?, ?, ? ? ??? ??? ?? ???? ???? ???, ??? ??, ?? ???? ?? ? ?? ??? ???? ??. ?? ??? ??? ???? ???? ????? ???? ???? ??
