|
@@ -27,10 +27,8 @@ import org.slf4j.LoggerFactory
|
|
|
import org.springframework.context.annotation.Configuration
|
|
|
import org.springframework.http.converter.HttpMessageConverter
|
|
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
|
|
|
-import org.springframework.web.servlet.config.annotation.CorsRegistry
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
|
|
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
|
|
|
|
|
@Configuration
|
|
|
open class WebMvcConfg: WebMvcConfigurer {
|
|
@@ -39,17 +37,6 @@ open class WebMvcConfg: WebMvcConfigurer {
|
|
|
private val logger = LoggerFactory.getLogger(WebMvcConfg::class.java)
|
|
|
} // Companion object
|
|
|
|
|
|
- override fun addCorsMappings(registry: CorsRegistry) {
|
|
|
-// super.addCorsMappings(registry)
|
|
|
- registry.addMapping("/**")
|
|
|
- .allowedOrigins("*")
|
|
|
- .allowedMethods("GET","POST","PUT","OPTIONS","DELETE","PATCH")
|
|
|
- .allowedHeaders("*")
|
|
|
- .allowCredentials(true)
|
|
|
- .maxAge(3600);
|
|
|
- super.addCorsMappings(registry)
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 配置拦截器
|
|
|
*
|
|
@@ -77,4 +64,5 @@ open class WebMvcConfg: WebMvcConfigurer {
|
|
|
converter.propertyNamingStrategy = PropertyNamingStrategy.CamelCase
|
|
|
converterList.add(converter)
|
|
|
}
|
|
|
+
|
|
|
} // Class WebMvcConf()
|