| | |
| | | |
| | | import java.io.File; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.http.server.reactive.ServerHttpResponse; |
| | | import org.springframework.web.cors.CorsUtils; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import org.springframework.web.server.WebFilter; |
| | | import org.springframework.web.server.WebFilterChain; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | |
| | | // 设置允许跨域请求的域名 |
| | | .allowedOrigins("*") |
| | | // 设置允许的方法 |
| | | .allowedMethods("GET"); |
| | | .allowedMethods("GET") |
| | | .allowedMethods("POST") |
| | | .allowedMethods("DELETE") |
| | | .allowedMethods("PUT"); |
| | | } |
| | | } |