一。允许全部请求跨域许可的代码:

需要继承WebMvcConfigurerAdapter类  

@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter{

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**");
    }

}
View Code

相关文章:

  • 2021-07-02
  • 2022-02-12
  • 2021-09-08
  • 2021-08-06
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-12-31
  • 2021-11-18
相关资源
相似解决方案