Browse Source

任务来源:机场

任务描述:shiro配置
develop
wubin 1 year ago
parent
commit
bd2b1b3f74
2 changed files with 4 additions and 1 deletions
  1. +3
    -1
      tuoheng-common/src/main/java/com/tuoheng/common/config/WebMvcConfig.java
  2. +1
    -0
      tuoheng-system/src/main/java/com/tuoheng/system/config/ShiroConfig.java

+ 3
- 1
tuoheng-common/src/main/java/com/tuoheng/common/config/WebMvcConfig.java View File

@Override @Override
protected void addCorsMappings(CorsRegistry registry) { protected void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") registry.addMapping("/**")
.allowedOrigins("*")
//SpringBoot升级2.4.0之后,跨域配置中的.allowedOrigins不再可用
// .allowedOrigins("*")
.allowedOriginPatterns("*")
.allowCredentials(true) .allowCredentials(true)
.allowedMethods(ORIGINS) .allowedMethods(ORIGINS)
.maxAge(3600); .maxAge(3600);

+ 1
- 0
tuoheng-system/src/main/java/com/tuoheng/system/config/ShiroConfig.java View File

filterChainDefinitionMap.put("/dronecode/generate", "anon"); filterChainDefinitionMap.put("/dronecode/generate", "anon");
//文件上传 //文件上传
filterChainDefinitionMap.put("/oss/uploadFile", "anon"); filterChainDefinitionMap.put("/oss/uploadFile", "anon");
filterChainDefinitionMap.put("/health/**", "anon");
// 所有url都必须认证通过才可以访问 // 所有url都必须认证通过才可以访问
filterChainDefinitionMap.put("/**", "authc"); filterChainDefinitionMap.put("/**", "authc");



Loading…
Cancel
Save