Commit 03694f4e authored by ms-dev's avatar ms-dev

更新

parent 1a101f61
...@@ -22,7 +22,7 @@ import net.mingsoft.basic.security.BaseAuthRealm; ...@@ -22,7 +22,7 @@ import net.mingsoft.basic.security.BaseAuthRealm;
@Configuration @Configuration
public class ShiroConfig { public class ShiroConfig {
@Value("managerPath") @Value("${ms.manager.path}")
private String managerPath; private String managerPath;
@Bean @Bean
...@@ -36,12 +36,11 @@ public class ShiroConfig { ...@@ -36,12 +36,11 @@ public class ShiroConfig {
shiroFilterFactoryBean.setSecurityManager(securityManager); shiroFilterFactoryBean.setSecurityManager(securityManager);
// 拦截器. // 拦截器.
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>(); Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
// 配置不会被拦截的链接 顺序判断,因为前端模板采用了thymeleaf,这里不能直接使用 ("/static/**", // 配置不会被拦截的链接 顺序判断,因为前端模板采用了thymeleaf,这里不能直接使用 ("/static/**", "anon")来配置匿名访问,必须配置到每个静态目录
// "anon")来配置匿名访问,必须配置到每个静态目录
filterChainDefinitionMap.put("/static/**", "anon"); filterChainDefinitionMap.put("/static/**", "anon");
filterChainDefinitionMap.put("/html/**", "anon"); filterChainDefinitionMap.put("/html/**", "anon");
filterChainDefinitionMap.put(managerPath+"/ms/checkLogin.do", "anon"); filterChainDefinitionMap.put(managerPath+"/checkLogin.do", "anon");
filterChainDefinitionMap.put(managerPath+"/ms/login.do", "anon"); filterChainDefinitionMap.put(managerPath+"/login.do", "anon");
// 配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了 // 配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了
filterChainDefinitionMap.put("/logout", "logout"); filterChainDefinitionMap.put("/logout", "logout");
// <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边 -->:这是一个坑呢,一不小心代码就不好使了; // <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边 -->:这是一个坑呢,一不小心代码就不好使了;
...@@ -50,7 +49,7 @@ public class ShiroConfig { ...@@ -50,7 +49,7 @@ public class ShiroConfig {
// 如果不设置默认会自动寻找Web工程根目录下的"/login.jsp"页面 // 如果不设置默认会自动寻找Web工程根目录下的"/login.jsp"页面
shiroFilterFactoryBean.setLoginUrl("/login"); shiroFilterFactoryBean.setLoginUrl("/login");
// 登录成功后要跳转的链接 // 登录成功后要跳转的链接
shiroFilterFactoryBean.setSuccessUrl("/index"); //shiroFilterFactoryBean.setSuccessUrl("/index");
// 未授权界面; // 未授权界面;
shiroFilterFactoryBean.setUnauthorizedUrl("/403"); shiroFilterFactoryBean.setUnauthorizedUrl("/403");
......
...@@ -2,15 +2,26 @@ server: ...@@ -2,15 +2,26 @@ server:
port: 8081 port: 8081
tomcat: tomcat:
max-http-header-size: 10240 #单位:字节 max-http-header-size: 10240 #单位:字节
ms: ms:
manager: ms manager:
view: path: ms
path: /WEB-INF/manager view:
path: /WEB-INF/manager
session:
managerPath: /ms timeout: 1800000 #会话超时, 单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms
validation.interval: 120000 #会话清理间隔时间, 单位:毫秒,2m=120000ms
upload:
floder:
path: /upload
file:
denied: exe
allowed: jpg
max:
size: 1
in:
memory:
size: 4096
spring: spring:
profiles: profiles:
active: dev active: dev
...@@ -53,10 +64,6 @@ mybatis: ...@@ -53,10 +64,6 @@ mybatis:
configuration: configuration:
database-id: mysql database-id: mysql
session:
timeout: 1800000 #会话超时, 单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms
validation.interval: 120000 #会话清理间隔时间, 单位:毫秒,2m=120000ms
# slf4j日志配置 # slf4j日志配置
logging: logging:
# 配置级别 # 配置级别
...@@ -66,14 +73,3 @@ logging: ...@@ -66,14 +73,3 @@ logging:
com.mingsoft: trace com.mingsoft: trace
upload:
floder:
path: /upload
file:
denied: exe
allowed: jpg
max:
size: 1
in:
memory:
size: 4096
\ No newline at end of file
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