Skip to content

Commit

Permalink
feat: 跨域处理
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzc19 committed Jul 14, 2024
1 parent 7909cda commit 36b4088
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.example.config

import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
class WebMvcConfig : WebMvcConfigurer {

override fun addCorsMappings(registry: CorsRegistry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("*")
.allowedHeaders("*")
}
}

0 comments on commit 36b4088

Please sign in to comment.