Files
hoperun-custom-sign/src/main/kotlin/com/pomelotea/hoperun/sign/config/WebConfig.kt

22 lines
633 B
Kotlin
Raw Normal View History

package com.pomelotea.hoperun.sign.config
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
/**
*
* @author jimlee
* @create 2024/11/1 13:15
*/
@Configuration
open class CorsConfig : WebMvcConfigurer {
override fun addCorsMappings(registry: CorsRegistry) {
registry.addMapping("/**")
.allowedMethods("*")
.allowedHeaders("*")
.allowedOriginPatterns("*")
.allowCredentials(true)
.maxAge(3600)
}
}