From 07fdc240d78cebe5360404b65b6e4c3997cfecb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 2 Apr 2025 14:04:41 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AE=BE=E7=BD=AE=E8=BF=87=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=B8=8E=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/web/listener/UserActionListener.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java b/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java index 07595e092..86d26edf7 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java @@ -1,6 +1,5 @@ package org.dromara.web.listener; -import cn.dev33.satoken.config.SaTokenConfig; import cn.dev33.satoken.listener.SaTokenListener; import cn.dev33.satoken.stp.SaLoginModel; import cn.dev33.satoken.stp.StpUtil; @@ -35,7 +34,6 @@ import java.time.Duration; @Slf4j public class UserActionListener implements SaTokenListener { - private final SaTokenConfig tokenConfig; private final SysLoginService loginService; /** @@ -59,10 +57,10 @@ public class UserActionListener implements SaTokenListener { dto.setDeviceType(loginModel.getDevice()); dto.setDeptName((String) loginModel.getExtra(LoginHelper.DEPT_NAME_KEY)); TenantHelper.dynamic(tenantId, () -> { - if(tokenConfig.getTimeout() == -1) { + if(loginModel.getTimeout() == -1) { RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto); } else { - RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(tokenConfig.getTimeout())); + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(loginModel.getTimeout())); } }); // 记录登录日志