22 lines
633 B
Kotlin
22 lines
633 B
Kotlin
|
|
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)
|
||
|
|
}
|
||
|
|
}
|