<em id="09ttv"></em>
    <sup id="09ttv"><pre id="09ttv"></pre></sup>
    <dd id="09ttv"></dd>

        • 獲取網頁授權

          2018-4-23    seo達人

          如果您想訂閱本博客內容,每天自動發到您的郵箱中, 請點這里

          在微信登錄中,如何和獲取網頁授權。

          一、登錄微信測試公眾品平臺,修改網頁授權基本信息,輸入授權回調頁面域名(自己的域名)。

          然后重新建立一個tp框架 編寫方法如圖:

          [php] view plain copy
          1. <?php  
          2. namespace Home\Controller;  
          3. use Think\Controller;  
          4. class IndexController extends Controller {  
          5.     public function index(){  
          6.        $appid='wx27f664ab15ecb71d';  
          7.        $redirect_uri=urlencode('http://www.crimson1.top/vote/index.php/home/index/getcode');  
          8.        $url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";  
          9.   
          10.              header("Location:".$url);  
          11.     }  
          12.   
          13.     public function getcode(){  
          14.         $code=$_GET["code"];  
          15.          $json=$this->access_token($code);  
          16.          echo $json;  
          17.     }  
          18.     public function access_token($code){  
          19.         $appid="wx27f664ab15ecb71d";  
          20.         $appsecret="015756334f2982ed1189c6d66dbc0353";  
          21.         $url="https://api.weixin.qq.com/sns/oauth2/access_token?appid=$appid&secret=$appsecret&code=$code&grant_type=authorization_code";  
          22.   
          23.         $ret=https_request($url);  
          24.         return $ret;  
          25.     }  
          26. }  

          在公共模塊中新建function.php

          [php] view plain copy
          1. <?php  
          2. function https_request($url){  
          3.     $curl=curl_init();  
          4.     curl_setopt($curl, CURLOPT_URL, $url);  
          5.     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);  
          6.     curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);  
          7.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
          8.     $data=curl_exec($curl);  
          9.     if(curl_errno($curl)){  
          10.         return 'ERROR'.curl_error($curl);  
          11.     }  
          12.     curl_close($curl);  
          13.     return $data;  
          14. }  

          在自己的手機端訪問,就能獲取access_token;

          藍藍設計m.sdgs6788.com )是一家專注而深入的界面設計公司,為期望卓越的國內外企業提供卓越的UI界面設計、BS界面設計 、 cs界面設計 、 ipad界面設計 、 包裝設計 、 圖標定制 、 用戶體驗 、交互設計、 網站建設 平面設計服務

          日歷

          鏈接

          個人資料

          藍藍設計的小編 http://m.sdgs6788.com

          存檔

          日韩人妻无码精品久久久不卡| a高清免费毛片久久| 久久精品www人人爽人人| 久久亚洲欧美日本精品| 午夜视频久久久久一区 | 亚洲午夜久久久久妓女影院| 国产精品久久亚洲不卡动漫| 亚洲欧美另类日本久久国产真实乱对白 | 久久国产免费直播| 久久精品国产亚洲av高清漫画 | 久久er99热精品一区二区| 久久免费观看视频| 精品久久8x国产免费观看| 久久天天躁狠狠躁夜夜不卡| 精品久久久久久久无码| 久久热这里只有精品在线观看| 国产精品久久久天天影视香蕉| 亚洲AV无一区二区三区久久 | 中文精品99久久国产| 日韩亚洲欧美久久久www综合网| 亚洲精品无码久久久久去q | 日本精品久久久久中文字幕8| 无码人妻久久一区二区三区| 无码任你躁久久久久久老妇App| 久久精品国产国产精品四凭| 久久久久国产一级毛片高清版| 天天爽天天狠久久久综合麻豆| 久久精品日日躁夜夜躁欧美| 少妇被又大又粗又爽毛片久久黑人 | 久久久久人妻一区二区三区| 亚洲国产精品狼友中文久久久 | 狠狠干狠狠久久| 久久亚洲精品中文字幕| 无码人妻少妇久久中文字幕蜜桃| 亚洲国产视频久久| 欧美久久久久久| 思思久久99热只有频精品66| 日韩人妻无码一区二区三区久久99 | 亚洲午夜精品久久久久久人妖| 精品综合久久久久久97超人 | 久久久无码精品午夜|