SpringBoot+SpringSecurity 跨域

 

 

 

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

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

 

上一篇:跨域问题


下一篇:Cookie学习笔记