feat(微服务治理工具): 优化Sentinel免登录逻辑

Sentinel登录状态默认30分钟失效,将Sentinel Token缓存过期时间调整为28分钟

Signed-off-by: OTTO <731554297@qq.com>
This commit is contained in:
OTTO 2025-03-07 15:33:22 +08:00
parent 4c8be09a72
commit e40d58ae9d
1 changed files with 2 additions and 1 deletions

View File

@ -90,7 +90,8 @@ public class ThirdPartyToolServiceImpl implements ThirdPartyToolService {
Map<String, Collection<String>> header = response.headers(); Map<String, Collection<String>> header = response.headers();
if (header != null && header.containsKey("set-cookie")) { if (header != null && header.containsKey("set-cookie")) {
sentinelCookie = header.get("set-cookie").iterator().next(); sentinelCookie = header.get("set-cookie").iterator().next();
redisService.setCacheObject(CacheConstants.SENTINEL_TOKEN, sentinelCookie, 12L, TimeUnit.HOURS); //Sentinel登录状态默认30分钟失效将Sentinel Token缓存过期时间调整为28分钟
redisService.setCacheObject(CacheConstants.SENTINEL_TOKEN, sentinelCookie, 28L, TimeUnit.MINUTES);
} }
} catch (TimeoutException e) { } catch (TimeoutException e) {
log.error("获取Sentinel Token超时"); log.error("获取Sentinel Token超时");