Pārlūkot izejas kodu

session配置永不过期,不删除在线会话信息

RuoYi 4 gadi atpakaļ
vecāks
revīzija
784cc3a10f

+ 0 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java

@@ -195,7 +195,6 @@ public class FileUploadUtils
                 throw new InvalidExtensionException(allowedExtension, extension, fileName);
             }
         }
-
     }
 
     /**

+ 5 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/OnlineWebSessionManager.java

@@ -103,6 +103,11 @@ public class OnlineWebSessionManager extends DefaultWebSessionManager
         int invalidCount = 0;
 
         int timeout = (int) this.getGlobalSessionTimeout();
+        if (timeout < 0)
+        {
+            // 永不过期不进行处理
+            return;
+        }
         Date expiredDate = DateUtils.addMilliseconds(new Date(), 0 - timeout);
         ISysUserOnlineService userOnlineService = SpringUtils.getBean(ISysUserOnlineService.class);
         List<SysUserOnline> userOnlineList = userOnlineService.selectOnlineByExpired(expiredDate);