springboot解决跨域访问

/**
 * 跨域设置
 * @Version 1.0.0
 * @Description
 */
@Configuration
public class CorsConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowCredentials(true)
                .allowedMethods("GET","POST","DELETE","PUT")
                .maxAge(3600);
    }
}
上一篇:Cookie学习笔记


下一篇:cookie