• <mark id="oc50q"></mark>
    <small id="oc50q"><code id="oc50q"></code></small>
    <optgroup id="oc50q"><li id="oc50q"><source id="oc50q"></source></li></optgroup>
  • <span id="oc50q"></span>
      1. 135用戶互聯


          1聯系135用戶互聯合作


          聯系135用戶互聯合作,獲得用戶互相的client_id, client_secret, 配置跳轉地址redirect_uri。

          2拼接135授權登錄鏈接


          授權登錄鏈接形如: http://www.135editor.com/oauth2/authorize?client_id=135plat&response_type=code&state=xyz&redirect_url=xxx

          參數說明:

          client_id 為135為您分配的合作方標識碼

          response_type參數使用固定值 code

          redirect_url 為配置好的授權后調整地址。

          state參數為任意值,會原樣返回

          3訪問登錄鏈接進入登錄頁面


          用戶點擊第二步拼接的授權登錄鏈接后,進入授權登錄頁,登錄并確認授權后,跳轉到回調地址。

          跳轉地址中會增加兩個參數,一個code,一個state


          3獲取access_token


          由于調用135編輯器會有跨域的問題,在135地址完成編輯時,會將結果提交到回調地址,通過回調地址調用最上層的內容使用函數。設置內容完成后,輸出iframe調用135編輯器的關閉頁面,關閉打開的135窗口。

          注意:需要設置內容輸出編碼為utf-8格式

          $result $this->post('http://www.135editor.com/oauth2/token', array( 
                      
          'grant_type' => 'authorization_code'
                      
          'code' => $_REQUEST['code'], 
                      
          'client_id' => '135plat'
                      
          'client_secret' => 'USpywDpmNNF25RGr',
                  )); 

          $token json_decode($result,true); 

          /**返回結果**/

          Array
          (
              [access_token] => 7ea5a1a688b9ca6158f5fedc26085845e06aadc0
              [expires_in] => 3600
              [token_type] => Bearer
              [scope] => 
              [refresh_token] => f2a5b7313a1c213ebe0d13c3f1b2a7413c8d87ee
          )



          4獲取135用戶信息


          Get請求獲取用戶信息

          $result = $this->get_contents('http://test.wx135.com/oauth2/resource?access_token='.$token['access_token']);

          $userinfo = json_decode($result,true);

          通過用戶id作為135用戶唯一識別,與站點建立用戶對應關系




        国产在线乱子伦一区二区|97爱色欧美亚洲综合图区|日韩精品a在线观看|亚洲综合网伊人中文
      2. <mark id="oc50q"></mark>
        <small id="oc50q"><code id="oc50q"></code></small>
        <optgroup id="oc50q"><li id="oc50q"><source id="oc50q"></source></li></optgroup>
      3. <span id="oc50q"></span>