代码优化
This commit is contained in:
@@ -67,6 +67,10 @@ if (!function_exists('requestCurl')) {
|
||||
$str = '';
|
||||
}
|
||||
}
|
||||
if ($str == '无效路径或登录状态失效'){
|
||||
Cache::rm('system_authorization_token');
|
||||
Cache::rm('system_refresh_token');
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user