Pārlūkot izejas kodu

任务来源:机场

任务描述:shiro配置
develop
wubin pirms 1 gada
vecāks
revīzija
bd2b1b3f74
2 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  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 Parādīt failu

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

+ 1
- 0
tuoheng-system/src/main/java/com/tuoheng/system/config/ShiroConfig.java Parādīt failu

@@ -92,6 +92,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/dronecode/generate", "anon");
//文件上传
filterChainDefinitionMap.put("/oss/uploadFile", "anon");
filterChainDefinitionMap.put("/health/**", "anon");
// 所有url都必须认证通过才可以访问
filterChainDefinitionMap.put("/**", "authc");


Notiek ielāde…
Atcelt
Saglabāt