后端解决跨域问题---SpringBoot

2022-03-25 Views106字1 min read

/**

  • 解决跨域问题
    */
    @Configuration
    public class CrosConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/**")
    .allowedOrigins("")
    .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
    .allowCredentials(flase)
    .maxAge(3600)
    .allowedHeaders("
    ");
    }
    }


©著作权归作者所有:来自51CTO博客作者Frank___7的原创作品,请联系作者获取转载授权,否则将追究法律责任
后端解决跨域问题---SpringBoot
https://blog.51cto.com/u_15305087/5003897

EOF