fix: access_token be an Array

pull/187/head
qkqpttgf 2021-01-15 19:26:01 +08:00 committed by GitHub
parent d5120aa390
commit 0b0f80c135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ class Aliyundrive {
$this->disktag = $tag; $this->disktag = $tag;
$this->auth_url = 'https://websv.aliyundrive.com/token/refresh'; $this->auth_url = 'https://websv.aliyundrive.com/token/refresh';
$this->api_url = 'https://api.aliyundrive.com/v2'; $this->api_url = 'https://api.aliyundrive.com/v2';
$this->access_token = $this->get_access_token(getConfig('refresh_token', $tag)); $res = $this->get_access_token(getConfig('refresh_token', $tag));
$this->default_drive_id = getConfig('default_drive_id', $tag); $this->default_drive_id = getConfig('default_drive_id', $tag);
} }
@ -710,6 +710,6 @@ class Aliyundrive {
savecache('access_token', $this->access_token, $this->disktag, $ret['expires_in'] - 300); savecache('access_token', $this->access_token, $this->disktag, $ret['expires_in'] - 300);
if (time()>getConfig('token_expires', $this->disktag)) setConfig([ 'refresh_token' => $ret['refresh_token'], 'token_expires' => time()+7*24*60*60 ], $this->disktag); if (time()>getConfig('token_expires', $this->disktag)) setConfig([ 'refresh_token' => $ret['refresh_token'], 'token_expires' => time()+7*24*60*60 ], $this->disktag);
} }
return $this->access_token; return true;
} }
} }