You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
564 B

5 months ago
  1. package com.qyft.ms.system.config;
  2. import org.springframework.context.annotation.Configuration;
  3. import org.springframework.web.servlet.config.annotation.CorsRegistry;
  4. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  5. @Configuration
  6. public class WebConfig implements WebMvcConfigurer {
  7. @Override
  8. public void addCorsMappings(CorsRegistry registry) {
  9. registry.addMapping("/**")
  10. .allowedOrigins("*")
  11. .allowedMethods("GET", "POST", "PUT", "DELETE")
  12. .allowedHeaders("*");
  13. }
  14. }