国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

??
1. access_token
? ?? ??? ?? ?? WeChat ?? ??? ?? access_token, log

WeChat ?? ??? ?? access_token, log

Mar 01, 2017 am 10:09 AM
?? ??

1. access_token

1) ? ?? access_token? ?? access_token? ? ??

1. WeChat ???? ??? ???? ??? ? ?????. ?? ?? ?????, ?? ??? ???? ??? ????? ?? ?? ??(???? ?? access_token)? ?? ? ???, ???? ?? access_token? ?? ?? ??? ?? ?? ? ?? ?? ????? ??? ??? ? ????.


2. ?? WeChat ?????? ?? ?? ???? "Get access_token" ?????? ?? ?? access_token ??? ??? ???. access_token? ?? ??? ????? ??? ?????. access_token? ?? ??? ?? 2???? ????? ?? ??? ???. ??? ??? access_token? ??????.

2) ?? access_token ??

1. ???? ??: ? ??? ???? ???? ?? ?? ??? ?? ?? ???? ??? ? ? ????. ??>

??? ???? ?? access_token?? ???? ?? ? ? ???, ? ??? WeChat? ?? ??? ?? ?? ??, ?? ?? ?? ? ????? ?? ??? ??? ?? ?????. , ??? ??????.

/**
?????*?創(chuàng)建一個(gè)需要通過微信的OAuth2.0認(rèn)證的服務(wù)url
?????*?@param?$url?服務(wù)號(hào)需要認(rèn)證訪問的url
?????*?@param?$scope?string?snsapi_userinfo?|?snsapi_base
?????*??????snsapi_userinfo?可以用來獲取用戶信息
?????*??????snsapi_base?可以用來獲取openid
?????*?@param?string?$state?自定義狀態(tài)值
?????*??????此處約定為from_weixin代表是從微信認(rèn)證過來,一般無需輕易變化
?????*?@return?string?返回認(rèn)證url地址
?????*/
????public?function?createAuthUrl($url,?$scope?=?'snsapi_base',?$state?=?'from_weixin')
????{
????????$url?=?strval($url);
????????$authUrl?=?'https://open.weixin.qq.com/connect/oauth2/authorize';
????????/**
?????????*?此處有大坑,請(qǐng)不要打亂param的順序
?????????*?否則微信認(rèn)證界面會(huì)出現(xiàn)白屏
?????????*/
????????$param?=?array(
????????????????'appid'?=>?$this->appId,
????????????????'redirect_uri'?=>?urlencode($url),
????????????????'response_type'?=>?'code',
????????????????'scope'?=>?$scope,
????????????????'state'?=>?$state
????????);
????
????????$seg?=?array();
????????foreach?($param?as?$k?=>?$v)?{
????????????$seg[]?=?"{$k}={$v}";
????????}
????????return?$authUrl?.?'?'?.?join('&',?$seg)?.?'#wechat_redirect';
????}

2. ??: ? ?? ????? ?? ?? ??? ?? ??? ??? ?????.

??? ???? ? ?? ??? ??? 2????? ??? ??? ????? MongoDB? ??? ? ?? ??????? ???? ??? ???????. ??? ???????. ??? ?? ?? ???? ??? ??? ?? ???????? ?? ?????.

2. ?? ??

WeChat?? ?? ?? ?? ?? ?? ??? ???? ??? ??? ??? ????. ?? ?? ??? ??? ?????. ???? MongoDB? ??? ?????. MongoDB? ??? ?? ??? ???? ??? ?? ? ??? ???. ? ??? ?? ??? ??? MySQL? ?? ???? ? ??? ??? ??? ?? ??? ??.

??? ??? URL(?? ??)? ?? ?? ????? ??? ???? ??? ??? ????? ???. ???? ??? ? ??? ??, ???? QR ?? ??, ??? ???? ??? ??, ??? ????? ?? ?? ?????.

?? ??? ??? ????.

1. ???? ?? ?? ??? ???? ????

2. 'php: //input')? ?? ?? ???? ?????, ?? ??? getRawMsg ???

3. ?? ??? MongoDB? ?? ??

4. ??? ?? ??? SimpleXMLElement ??? ??? ?? ?? ?? ???

5. handlerEventMsg? ??? ??? ?????.

/**
?????*?微信公眾號(hào)入口
?????*/
????public?function?actionPortal()
????{
????????$weixin?=?new?Weixin();
????????//簽名驗(yàn)證邏輯
//?????????if($weixin->checkSignature()){
//?????????????echo?$_GET['echostr'];
//?????????}
//?????????exit;
????????//讀取原始請(qǐng)求數(shù)據(jù)
????????$msg?=?$weixin->getRawMsg();
????????
????????//推送日志
????????$pushlog?=?new?WeixinPushLog();
????????$pushlog->logWeixinPush($msg);
????????
????????$msgObj?=?$weixin->parseMsg($msg);
????????if?($msgObj?===?false?||?!is_object($msgObj))?{
????????????exit;
????????}
????????switch?($msgObj->MsgType)?{
????????????case?'event'?:?//接收事件消息
????????????????$this->handleEventMsg($msgObj);
????????????????break;
????????????default?:
????????????????//todo
????????????????break;
????????}
????}

public?function?getRawMsg()
????{
????????return?file_get_contents('php://input');
????}

????/**
?????*?解析接收到的消息
?????*?@param?string?$msg?消息體
?????*?@return?bool|SimpleXMLElement
?????*/
????public?function?parseMsg($msg?=?'')
????{
????????if?(!$msg?||?empty($msg))?{
????????????return?false;
????????}
????????$msgObj?=?simplexml_load_string($msg,?'SimpleXMLElement',?LIBXML_NOCDATA);
????????if?($msgObj?===?false?||?!($msgObj?instanceof?\SimpleXMLElement))?{
????????????return?false;
????????}
????????return?$msgObj;
????}

6. ???? ????? ?? ???? ???? ???

7. ?? ??? ?? ???? ?? ??? ? ??? ?????.

8. createRawTuWenMsg? XML? ???? ????. ??? ??? ?????? ??? ?????.

private?function?handleEventMsg($msgObj)
????{
????????$weixin?=?new?Weixin();
????????$openId?=?$msgObj->FromUserName;
????????$fromUserName?=?$msgObj->ToUserName;
????????//未關(guān)注,關(guān)注后推送
????????if?($msgObj->Event?==?'subscribe')?{
????????????$pushData['PicUrl']?=?'http://mmbiz.qpic.cn/';
????????????$pushData['Title']?=?'基因檢測(cè),帶你一起探索生命的奧妙?';
????????????$pushData['Description']?=?'為什么不同人在身高、體重、膚色和形狀上長(zhǎng)得不一樣?但是往往又和自己的父母相似?';
????????????$pushData['Url']?=?'http://mp.weixin.qq.com';
????????????$msg?=?$weixin->createRawTuWenMsg($fromUserName,?$openId,?array($pushData));

????????????die($msg);
????????}elseif($msgObj->Event?==?'CLICK'){
????????????//die($msg);
????????}
????}

public?function?createRawTuWenMsg($fromUserName,?$toUserName,?$items?=?array())
????{
????????if?(!is_array($items))?{
????????????return?'';
????????}
????????$count?=?count($items);
????????$its?=?'';
????????foreach?($items?as?$item)?{
????????????$its?.=?<<<ITEMTPL
<item>
<Title><![CDATA[{$item[&#39;Title&#39;]}]]></Title>
<Description><![CDATA[{$item[&#39;Description&#39;]}]]></Description>
<PicUrl><![CDATA[{$item[&#39;PicUrl&#39;]}]]></PicUrl>
<Url><![CDATA[{$item[&#39;Url&#39;]}]]></Url>
</item>
ITEMTPL;
????????}
????
????????$msg?=?<<<MSG
<xml>
<ToUserName><![CDATA[{$toUserName}]]></ToUserName>
<FromUserName><![CDATA[{$fromUserName}]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[news]]></MsgType>
<ArticleCount>{$count}</ArticleCount>
<Articles>
{$its}
</Articles>
</xml>
MSG;
????return?$msg;
????}
?? ????:

github ??: https://github.com/pwstrick/weixin_demo

CSDN ??: http://download.csdn.net/detail/loneleaf1/9045731

WeChat ?? ??? ?? access_token ? ??? ??? ? ?? ??? ??? PHP ??? ????? ?????. !

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

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

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
PHP WeChat ??: ??? ??? ? ?? ?? ?? ?? PHP WeChat ??: ??? ??? ? ?? ?? ?? ?? May 13, 2023 am 11:40 AM

PHP? ? ?? ? ?? ? ?????, ?? WeChat ??? ?? ???? ?? ?? ???? ?????. ??? ?? ? ?? ??? ???? WeChat ??? PHP? ???? ???? ????. PHP? ??? ?? ???? ?? ?? ???? ?????. WeChat ???? ??? ??? ? ???? ??? ??? ???? ?? ??? ?? ??? ?????. ??? ? ??? ??? ?? ???? ?? ??? ?? ???? ??? ? ?? ????? ??? ? ? ????.

PHP WeChat ??: ?? ?? ?? ?? PHP WeChat ??: ?? ?? ?? ?? May 14, 2023 am 11:21 AM

WeChat ?? ??? ??? ? ?? ??? ?? ?????. ?? ??? ????? ?? ??? ??? ??? ? ?? ?? ????, ??? ?? ? ?? ??? ?? ??? ????? ???. ? ????? PHP? ???? WeChat ?? ??? ???? ??? ?????. WeChat ?? ?? ??? ???? ?? WeChat ?? ?? ??? ??? ???. WeChat ?? ?????? WeChat ?? ??, ?? ?? ? ?? ??? ???? ??? API ??? ???? ???. PHP ??? ???? ???? ???? WeChat?? ????? ???? PH? ???? ???.

PHP? ???? WeChat ?? ??? ?? ?? PHP? ???? WeChat ?? ??? ?? ?? May 13, 2023 pm 05:00 PM

WeChat? ??? ?? ?? ? ?? ??? WeChat? ??? ??? ???? ??????. WeChat ?? ??? ??? ??? WeChat ???? ???? ??? ?? ? ?????. ??? ?? ???? ????? ??? ?????? ?? ??? ?? ??? ?? ?????. ??? WeChat ?? ??? ??? ???? ?? ?? ?????. ? ????? PHP? ???? WeChat ?? ??? ??? ???? ??? ?????. 1. ?? ?? WeChat ?? ??? ??? ????? ?? ?? ??? ???? ???. PHP WeChat ?? ??? ??? ?? ?? ?? ?? ??: Sub

PHP WeChat ??: ?? ??? ?? ? ?? ?? ?? PHP WeChat ??: ?? ??? ?? ? ?? ?? ?? May 13, 2023 pm 05:51 PM

WeChat? ?? ???? ?? ? ??? ??? ??? ?? ??? ? ?????. ??? ???? ??? ?? ?? ? ?? ???? WeChat ???? ???? ??? ??????. WeChat ???? ??? ? ?? ???? ??? ?????. ?? ??? ?? ?? ? ? ???? ?? WeChat ??? PHP ??? ??? ? ????. 1. PHP ?? WeChat ?? PHP? ? ?? ???? ?? ???? ?? ?? ?? ? ???? ?????. WeChat ?? ????? ???? ?? ?????? ???? PHP ??? ???? WeChat? ??? ? ????.

PHP WeChat ??: ??? ?? ?? ?? ?? PHP WeChat ??: ??? ?? ?? ?? ?? May 13, 2023 pm 04:31 PM

WeChat ?? ?? ???? ??? ?? ??? ???? ???? ? ? ???? ??? ? ??? ?? ?? ??? ?????. ? ????? PHP? ???? WeChat ??? ?? ?? ??? ???? ??? ?????. 1. WeChat ???? openid? ?????. WeChat ??? ?? ?? ??? ???? ?? ?? ???? openid? ???? ???. WeChat ?? ??? ??? ? ??? ??? ?? openid? ?? ?? ???? ?????. ??? ??? ???? ?? ??? ?? ???? ?? ? ????.

PHP WeChat ??: ?? ??? ?? ??? ???? ?? PHP WeChat ??: ?? ??? ?? ??? ???? ?? May 13, 2023 pm 04:31 PM

WeChat? ???? ??? ?? ? ??? ?????? ??? ???, WeChat? ??? ??? ??? ?? ??? ??? ??? ??? ?? ????. ??? ?? WeChat? ??? ????? ???? ?? ??? ??? ???? WeChat ??? ???? ?? ?? ???? ????. ? ? ?? ?? ??? ?? ?? ?????. ???? PHP ??????? ?? ??? ?? ??? ??? ???? ???? ??? ??? ?????. 1. WeChat ?? ??? ??? ?? ??? ?????. ?? ??? ?? ??? ???? ??? ?????.

PHP? ???? WeChat ?? ?? ??? ???? ?? PHP? ???? WeChat ?? ?? ??? ???? ?? Jun 27, 2023 pm 12:26 PM

PHP? ???? WeChat ?? ??? ???? ?? WeChat ?? ??? ?? ??? ?? ? ?? ??? ?? ??? ??? ????, ????? ???? ? ??? PHP? ???? WeChat ?? ??? ??? ?? ????. ? ????? PHP? ???? WeChat ?? ??? ???? ???? ??? ?????. 1??: WeChat ?? ??? ??? ??? ????. WeChat ?? ?? ??? ???? ?? WeChat ?? ??? ??? ??? ???? ???. ???? ?? ??? WeChat ?? ??? ?? ????? ?????.

WeChat ??? PHP? ???? ??? ?????? WeChat ??? PHP? ???? ??? ?????? May 21, 2023 am 08:37 AM

???? ??? ??? ??? ???? WeChat? ?? ? ??? ???? ???? ?? ??? ?????. ?? ? ?????? ??? WeChat ??? PHP? ???? ??? ?? ???? ??? ?????. ? ????? ?? WeChat ??? PHP? ???? ??? ?? ?? ?? ???? ?? ? ? ?? ??? ?????. 1. ?? ?? ?? WeChat? ???? ?? ?? ?? ?? ??? ???? ???. ??, PHP ?? ??? WeChat ?? ???? ???? ???.

See all articles