Commit 02470903 authored by AfirSraftGarrier's avatar AfirSraftGarrier

回退给亿迅

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