feat: There is no way the WebMvcConfigurer

This commit is contained in:
super_liu
2021-08-19 11:35:10 +08:00
parent c9d0b60863
commit 7c7be1065c
@@ -0,0 +1,25 @@
package com.adc.da.main.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* @Description: TODO
* @author: super_liu
* @date: 2021年08月19日 11:28
*/
@Configuration
public class MyConfiguration implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowCredentials(true)
.allowedMethods("GET", "POST", "DELETE", "PUT")
.maxAge(3600);
}
}