Commit 02470903 authored by AfirSraftGarrier's avatar AfirSraftGarrier

回退给亿迅

parent 8dda7fee
...@@ -5,7 +5,11 @@ import lombok.extern.slf4j.Slf4j; ...@@ -5,7 +5,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration @Configuration
@EnableWebMvc @EnableWebMvc
...@@ -24,11 +28,8 @@ public class CorsConfig implements WebMvcConfigurer { ...@@ -24,11 +28,8 @@ public class CorsConfig implements WebMvcConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") registry.addMapping("/**")
// 合并到yx需要添加上白名单 .allowedOrigins(allowedOrigins)
// .allowedOrigins(allowedOrigins) .allowedMethods(allowedMethods)
// .allowedMethods(allowedMethods)
.allowedOrigins("*")
.allowedMethods("*")
.allowCredentials(true) .allowCredentials(true)
.maxAge(3600) .maxAge(3600)
.allowedHeaders("*"); .allowedHeaders("*");
...@@ -44,4 +45,5 @@ public class CorsConfig implements WebMvcConfigurer { ...@@ -44,4 +45,5 @@ public class CorsConfig implements WebMvcConfigurer {
registry.addInterceptor(authenticationInterceptor) registry.addInterceptor(authenticationInterceptor)
.addPathPatterns("/**"); .addPathPatterns("/**");
} }
} }
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