更新shiro版本,去除sessionid url显示问题
This commit is contained in:
parent
50782498a6
commit
70d55f663d
|
@ -14,6 +14,7 @@ import org.apache.shiro.spring.LifecycleBeanPostProcessor;
|
||||||
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
|
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
|
||||||
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
|
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
|
||||||
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
|
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
|
||||||
|
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
|
||||||
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
|
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
@ -64,6 +65,7 @@ public class ShiroConfig {
|
||||||
DefaultWebSecurityManager dwm=new DefaultWebSecurityManager();
|
DefaultWebSecurityManager dwm=new DefaultWebSecurityManager();
|
||||||
dwm.setRealm(loginRealm);
|
dwm.setRealm(loginRealm);
|
||||||
dwm.setCacheManager(getCacheManager());
|
dwm.setCacheManager(getCacheManager());
|
||||||
|
dwm.setSessionManager(defaultWebSessionManager());
|
||||||
return dwm;
|
return dwm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +120,17 @@ public class ShiroConfig {
|
||||||
as.setSecurityManager(securityManager);
|
as.setSecurityManager(securityManager);
|
||||||
return as;
|
return as;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public DefaultWebSessionManager defaultWebSessionManager() {
|
||||||
|
DefaultWebSessionManager defaultWebSessionManager = new DefaultWebSessionManager();
|
||||||
|
defaultWebSessionManager.setSessionIdCookieEnabled(true);
|
||||||
|
defaultWebSessionManager.setGlobalSessionTimeout(21600000);
|
||||||
|
defaultWebSessionManager.setDeleteInvalidSessions(true);
|
||||||
|
defaultWebSessionManager.setSessionValidationSchedulerEnabled(true);
|
||||||
|
defaultWebSessionManager.setSessionIdUrlRewritingEnabled(false);
|
||||||
|
return defaultWebSessionManager;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
@Bean
|
@Bean
|
||||||
public FilterRegistrationBean delegatingFilterProxy(){
|
public FilterRegistrationBean delegatingFilterProxy(){
|
||||||
|
|
44
pom.xml
44
pom.xml
|
@ -94,11 +94,11 @@
|
||||||
<artifactId>spring-boot-starter-logging</artifactId>
|
<artifactId>spring-boot-starter-logging</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- <dependency>
|
<!-- <dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
<version>1.5.9.RELEASE</version>
|
<version>1.5.9.RELEASE</version>
|
||||||
</dependency>-->
|
</dependency>-->
|
||||||
|
|
||||||
|
|
||||||
<!--Mysql数据库驱动-->
|
<!--Mysql数据库驱动-->
|
||||||
|
@ -175,7 +175,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-ehcache</artifactId>
|
<artifactId>shiro-ehcache</artifactId>
|
||||||
<version>1.2.2</version>
|
<version>1.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-aspectj -->
|
<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-aspectj -->
|
||||||
|
@ -197,7 +197,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-core</artifactId>
|
<artifactId>shiro-core</artifactId>
|
||||||
<version>1.2.3</version>
|
<version>1.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
||||||
|
@ -211,12 +211,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-web</artifactId>
|
<artifactId>shiro-web</artifactId>
|
||||||
<version>1.2.3</version>
|
<version>1.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-spring</artifactId>
|
<artifactId>shiro-spring</artifactId>
|
||||||
<version>1.2.3</version>
|
<version>1.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -327,7 +327,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-quartz</artifactId>
|
<artifactId>shiro-quartz</artifactId>
|
||||||
<version>1.2.3</version>
|
<version>1.3.2</version>
|
||||||
<!-- 解决 shiro和quartz 冲突-->
|
<!-- 解决 shiro和quartz 冲突-->
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
|
@ -422,18 +422,18 @@
|
||||||
<overwrite>true</overwrite>
|
<overwrite>true</overwrite>
|
||||||
<verbose>true</verbose>
|
<verbose>true</verbose>
|
||||||
</configuration>
|
</configuration>
|
||||||
<!-- <dependencies>
|
<!-- <dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>${mysql.version}</version>
|
<version>${mysql.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>tk.mybatis</groupId>
|
<groupId>tk.mybatis</groupId>
|
||||||
<artifactId>mapper</artifactId>
|
<artifactId>mapper</artifactId>
|
||||||
<version>4.0.0</version>
|
<version>4.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>-->
|
</dependencies>-->
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
Loading…
Reference in New Issue