wupengfei 1 anno fa
parent
commit
d1049076f3
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      application/api/controller/Kuaishou.php

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

@@ -12,12 +12,18 @@ class Kuaishou extends Base
    // public $access_token = 'ChFvYXV0aC5hY2Nlc3NUb2tlbhJwoKoSq1Hr4odNgoU9P9bwE23fS9T_KUXue57LmD9Nks584givB9Tqi_z05o7KDDvwj3ZAIBzly56LPLr-bekP61JOxIt8lMmuaOEODBndmTz5CrYQfiRIn-mbKwTYDPIXeJZLWN5nwwmaUP-G85DF7xoSOYuaoIMQQbq8-XpVu7XiJ6dNIiBtFILUcnKsia-OUP2G6Xja4G2Ub9uR4rKP7YVWTVe1BCgFMAE';
     public $access_token = 'ChFvYXV0aC5hY2Nlc3NUb2tlbhJwkJH4kE3_XC9VYpL9YT_CQlKFGChKnZjvs7iq9kTkJO';
     public $debug = false;
-    public $code = "e74d269aa93aa4434335c4d3e9a1773d169a36f6c65b965a726a1d3c8b85699e72ec817a";
+    public $code = "ae727ca7a93aa4434335c4d3e9a1773d169a36f6c65b965a726a1d3c8b85699e62cfd671";
 
     public function notify()
     {
         $data = $this->request->param();
-        var_dump($data);
+        $url = $this->serverHost . "oauth2/access_token?app_id={$this->appKey}&app_secret={$this->appSecret}&code={$data['code']}&grant_type=authorization_code";
+        $Alibabahelper = new Alibabahelper();
+        $s = $Alibabahelper->curl_https_get($url);
+        $s = json_decode($s, true);
+        var_dump($data,$s);
+        return  isset($s['access_token']) ? $s['access_token'] : '';
+
     }
 
     //