wupengfei 1 rok temu
rodzic
commit
8742726206
1 zmienionych plików z 7 dodań i 2 usunięć
  1. 7 2
      application/api/controller/Kuaishou.php

+ 7 - 2
application/api/controller/Kuaishou.php

@@ -12,9 +12,14 @@ class Kuaishou extends Base
     public $access_token = '';
     public $debug = false;
     //
-    public static function getAccessToken()
+    public  function getAccessToken()
     {
-
+        //$url = $this->serverHost . "oauth2/access_token?app_id={$this->appKey}&app_secret={$this->appSecret}&code={$code}&grant_type=authorization_code";
+        $url = $this->serverHost . "oauth2/access_token?app_id={$this->appKey}&app_secret={$this->appSecret}&grant_type=client_credentials";
+        $Alibabahelper = new Alibabahelper();
+        $s = $Alibabahelper->curl_https_get($url);
+        $s = json_decode($s, true);
+        $this->success('ok',$s);
     }
 
     // api请求