Commit e64ec4b3 by naan1993

删掉旧的session过期时间

parent 79ad5c92
...@@ -8,7 +8,7 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR ...@@ -8,7 +8,7 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
* @author fengshuonan * @author fengshuonan
* @date 2017-07-13 21:05 * @date 2017-07-13 21:05
*/ */
@EnableRedisHttpSession @EnableRedisHttpSession(maxInactiveIntervalInSeconds = 1800) //session过期时间
public class SpringSessionConfig { public class SpringSessionConfig {
......
...@@ -28,10 +28,6 @@ public class GunsProperties { ...@@ -28,10 +28,6 @@ public class GunsProperties {
private Boolean haveCreatePath = false; private Boolean haveCreatePath = false;
private Integer sessionInvalidateTime = 30 * 60; //session 失效时间(默认为30分钟 单位:秒)
private Integer sessionValidationInterval = 15 * 60; //session 验证失效时间(默认为15分钟 单位:秒)
public String getFileUploadPath() { public String getFileUploadPath() {
//如果没有写文件上传路径,保存到临时目录 //如果没有写文件上传路径,保存到临时目录
if (isEmpty(fileUploadPath)) { if (isEmpty(fileUploadPath)) {
...@@ -71,19 +67,4 @@ public class GunsProperties { ...@@ -71,19 +67,4 @@ public class GunsProperties {
this.swaggerOpen = swaggerOpen; this.swaggerOpen = swaggerOpen;
} }
public Integer getSessionInvalidateTime() {
return sessionInvalidateTime;
}
public void setSessionInvalidateTime(Integer sessionInvalidateTime) {
this.sessionInvalidateTime = sessionInvalidateTime;
}
public Integer getSessionValidationInterval() {
return sessionValidationInterval;
}
public void setSessionValidationInterval(Integer sessionValidationInterval) {
this.sessionValidationInterval = sessionValidationInterval;
}
} }
...@@ -51,25 +51,6 @@ public class ShiroConfig { ...@@ -51,25 +51,6 @@ public class ShiroConfig {
return new ServletContainerSessionManager(); return new ServletContainerSessionManager();
} }
///**
// * session管理器
// */
//@Bean
//public DefaultWebSessionManager defaultWebSessionManager(CacheManager cacheShiroManager, GunsProperties gunsProperties) {
// DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
// sessionManager.setCacheManager(cacheShiroManager);
// sessionManager.setSessionValidationInterval(gunsProperties.getSessionValidationInterval() * 1000);
// sessionManager.setGlobalSessionTimeout(gunsProperties.getSessionInvalidateTime() * 1000);
// sessionManager.setDeleteInvalidSessions(true);
// sessionManager.setSessionValidationSchedulerEnabled(true);
// Cookie cookie = new SimpleCookie(ShiroHttpSession.DEFAULT_SESSION_ID_NAME);
// cookie.setName("shiroCookie");
// cookie.setHttpOnly(true);
// sessionManager.setSessionIdCookie(cookie);
// return sessionManager;
//}
/** /**
* 缓存管理器 使用Ehcache实现 * 缓存管理器 使用Ehcache实现
*/ */
......
...@@ -31,7 +31,7 @@ public class SessionTimeoutInterceptor extends BaseController { ...@@ -31,7 +31,7 @@ public class SessionTimeoutInterceptor extends BaseController {
String servletPath = HttpKit.getRequest().getServletPath(); String servletPath = HttpKit.getRequest().getServletPath();
if (servletPath.equals("/kaptcha") || servletPath.equals("/login")) { if (servletPath.equals("/kaptcha") || servletPath.equals("/login") || servletPath.equals("/global/sessionError")) {
return point.proceed(); return point.proceed();
}else{ }else{
if(ShiroKit.getSession().getAttribute("sessionFlag") == null){ if(ShiroKit.getSession().getAttribute("sessionFlag") == null){
......
...@@ -8,8 +8,6 @@ guns: ...@@ -8,8 +8,6 @@ guns:
kaptcha-open: false #是否开启登录时验证码 (true/false) kaptcha-open: false #是否开启登录时验证码 (true/false)
session-open: false #是否开启session验证 (true/false) session-open: false #是否开启session验证 (true/false)
#file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) #file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录)
session-invalidate-time: 1800 #session失效时间 单位:秒
session-validation-interval: 900 #多久检测一次失效的session 单位:秒
muti-datasource-open: false #是否开启多数据源(true/false) muti-datasource-open: false #是否开启多数据源(true/false)
################### 项目启动端口 ################### ################### 项目启动端口 ###################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment