From 0b6cb4ba66b64f20b6ae6cdfe6054d07767a93f8 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 7 Apr 2020 20:54:10 +0800 Subject: [PATCH] fix: shareurl no apiurl --- common.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 8f6b887..f9c8e7c 100644 --- a/common.php +++ b/common.php @@ -345,7 +345,9 @@ function get_access_token($refresh_token) } error_log('Get access token:'.json_encode($ret, JSON_PRETTY_PRINT)); savecache('access_token', $_SERVER['access_token']); - if (getConfig('sharecookie')==''||getConfig('shareapiurl')=='') setConfig([ 'sharecookie' => $_SERVER['sharecookie'], 'shareapiurl' => $_SERVER['api_url'] ]); + $tmp = []; + $tmp['shareapiurl'] = $_SERVER['api_url']; + if (getConfig('shareapiurl')=='') setConfig($tmp); } else { $response = curl_request( $_SERVER['oauth_url'] . 'token', 'client_id='. $_SERVER['client_id'] .'&client_secret='. $_SERVER['client_secret'] .'&grant_type=refresh_token&requested_token_use=on_behalf_of&refresh_token=' . $refresh_token ); if ($response['stat']==200) $ret = json_decode($response['body'], true);