From 2e98b20bea4463e4465e3c19059d0744a09aec06 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Tue, 27 Jun 2023 14:34:41 +0800
Subject: [PATCH] gb28181版本升级-补充
---
src/main/java/com/genersoft/iot/vmp/conf/security/InvalidSessionHandler.java | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/InvalidSessionHandler.java b/src/main/java/com/genersoft/iot/vmp/conf/security/InvalidSessionHandler.java
new file mode 100644
index 0000000..f3fd068
--- /dev/null
+++ b/src/main/java/com/genersoft/iot/vmp/conf/security/InvalidSessionHandler.java
@@ -0,0 +1,24 @@
+package com.genersoft.iot.vmp.conf.security;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.web.session.InvalidSessionStrategy;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 登录超时的处理
+ */
+public class InvalidSessionHandler implements InvalidSessionStrategy {
+
+ private final static Logger logger = LoggerFactory.getLogger(InvalidSessionHandler.class);
+
+ @Override
+ public void onInvalidSessionDetected(HttpServletRequest request, HttpServletResponse httpServletResponse) throws IOException, ServletException {
+ String username = request.getParameter("username");
+ logger.info("[登录超时] - [{}]", username);
+ }
+}
--
Gitblit v1.9.3