添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
高大的烤红薯  ·  请求配置 | UNI-AJAX·  2 周前    · 
紧张的红金鱼  ·  android.os.BadParcelab ...·  1 周前    · 
犯傻的水龙头  ·  AWS SDK for ...·  1 周前    · 
重感情的羊肉串  ·  Content Page·  6 月前    · 
爱旅游的佛珠  ·  MuleSoft Help Center·  7 月前    · 
果断的可乐  ·  1103_1103csdn-CSDN博客·  7 月前    · 
package com.ftest.springboot.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CrosConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
                .allowCredentials(true)
                .allowedHeaders("*")
                .maxAge(3600);

这样就不用担心跨域了!