|
@@ -79,10 +79,13 @@ function __construct(){
|
|
|
$userpwd = $client_id . ':' . $secret_id;
|
|
$userpwd = $client_id . ':' . $secret_id;
|
|
|
$info = $this->_curl($data,$url,3000,$method,true,$header,$userpwd);
|
|
$info = $this->_curl($data,$url,3000,$method,true,$header,$userpwd);
|
|
|
$result = json_decode($info,true);
|
|
$result = json_decode($info,true);
|
|
|
- $access_new = (time() + $result['expires_in']) . ':' . $result['access_token'];
|
|
|
|
|
|
|
+ var_dump($result);
|
|
|
|
|
+ $expires_in = empty($result['expires_in']) ? 100 : $result['expires_in'];
|
|
|
|
|
+ $access_token = empty($result['access_token']) ? '' : $result['access_token'];
|
|
|
|
|
+ $access_new = (time() + $expires_in) . ':' . $access_token;
|
|
|
fwrite($file, $access_new);
|
|
fwrite($file, $access_new);
|
|
|
fclose($file);
|
|
fclose($file);
|
|
|
- $hf_access_token = $result['access_token'];
|
|
|
|
|
|
|
+ $hf_access_token = $access_token;
|
|
|
}
|
|
}
|
|
|
return $hf_access_token;
|
|
return $hf_access_token;
|
|
|
}
|
|
}
|