From b9cb8ac5f30d65c438588f8e0595d4df9bcb339c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 8 Sep 2023 09:12:38 +0800 Subject: [PATCH] =?UTF-8?q?session=E9=94=80=E6=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/user/controller/UserAuthController.java | 2 +- .../pmapi/user/security/auth/constants/SessionTimeConstant.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java index 951e0d0..aaff21c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java @@ -75,7 +75,7 @@ public class UserAuthController { response.setContentType(StrPool.CONTENT_TYPE); Cookie cookie = new Cookie(BizConst.COOKIE_KEY, null); cookie.setPath(request.getContextPath() + "/"); - cookie.setMaxAge(SessionTimeConstant.SESSION_TIME_SECONDS); + cookie.setMaxAge(SessionTimeConstant.SESSION_EXPIRED); response.addCookie(cookie); response.setStatus(HttpStatus.UNAUTHORIZED.value()); response.getWriter().write(objectMapper.writeValueAsString(BizConst.UNAUTHENTICATED)); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/constants/SessionTimeConstant.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/constants/SessionTimeConstant.java index a375263..f86e6dd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/constants/SessionTimeConstant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/constants/SessionTimeConstant.java @@ -8,5 +8,6 @@ package com.ningdatech.pmapi.user.security.auth.constants; public class SessionTimeConstant { public static final Integer SESSION_TIME_SECONDS = 24 * 60 * 60 * 10; + public static final Integer SESSION_EXPIRED = 0; }