src/main/java/com/whyc/config/ShiroConfig.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/LoginService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/config/application-dev.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/config/application-prod.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/config/ShiroConfig.java
@@ -42,7 +42,7 @@ cookie.setHttpOnly(false); cookie.setSameSite(Cookie.SameSiteOptions.NONE); cookie.setSecure(true); cookie.setName("MSManager"); cookie.setName("bg"); sessionManager.setSessionIdCookie(cookie); sessionManager.setSessionIdCookieEnabled(true); sessionManager.setSessionIdUrlRewritingEnabled(true); src/main/java/com/whyc/service/LoginService.java
@@ -52,7 +52,7 @@ request.getServletContext().setAttribute(name,request.getSession().getId()); //Session存储当前用户 request.getSession().setAttribute("user",subject.getPrincipal()); request.getSession().setMaxInactiveInterval(60); //request.getSession().setMaxInactiveInterval(600); return new Response<>().setII(1,true,subject.getPrincipal(),"登录成功"); } return new Response<>().set(1,false,"密码错误"); @@ -172,7 +172,7 @@ loginMap.put(userName, dateStr); //Session存储当前用户及权限组列表 request.getSession().setAttribute("user", subject.getPrincipal()); request.getSession().setMaxInactiveInterval(60*60*24); //request.getSession().setMaxInactiveInterval(60*60*24); //清除账号登录失败记录 while (attributeNames.hasMoreElements()) { String attributeName = attributeNames.nextElement(); src/main/resources/config/application-dev.yml
@@ -5,11 +5,13 @@ servlet: context-path: /bg session: timeout: -1 #session超时时间,默认30分钟 timeout: 30m cookie: name: bg http-only: true max-age: 60 #cookie关闭浏览器后失效 max-age: -1 tomcat: max-http-form-post-size: 102400000 http: src/main/resources/config/application-prod.yml
@@ -5,7 +5,7 @@ servlet: context-path: /bg session: timeout: -1 timeout: 30m cookie: name: bg http-only: true