From 4b649a0716b2ef16d6a5a1b5989ce4f196fe9809 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Tue, 8 Jul 2025 14:43:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/common.php | 4 ++++ Server/application/common/service/AuthService.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Server/application/common.php b/Server/application/common.php index d412b53a..f603ea90 100644 --- a/Server/application/common.php +++ b/Server/application/common.php @@ -67,6 +67,10 @@ if (!function_exists('requestCurl')) { $str = ''; } } + if ($str == '无效路径或登录状态失效'){ + Cache::rm('system_authorization_token'); + Cache::rm('system_refresh_token'); + } return $str; } } diff --git a/Server/application/common/service/AuthService.php b/Server/application/common/service/AuthService.php index aac5fbd1..5eb19b01 100644 --- a/Server/application/common/service/AuthService.php +++ b/Server/application/common/service/AuthService.php @@ -235,8 +235,8 @@ class AuthService $authorization = $result_array['access_token']; // 存入缓存,有效期10分钟(600秒) - Cache::set($cacheKey, $authorization, 600); - Cache::set('system_refresh_token', $result_array['refresh_token'], 600); + Cache::set($cacheKey, $authorization, 200); + Cache::set('system_refresh_token', $result_array['refresh_token'], 200); Log::info('已重新获取系统授权信息并缓存'); return $authorization;