项目场景:
问题描述:
前端报错
Access to XMLHttpRequest at 'http://localhost:9001/cmsservice/banner/getAllBanner' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
访问位于“”的XMLHttpRequesthttp://localhost:9001/cmsservice/banner/getAllBanner“起源”http://localhost:3000’已被CORS策略阻止:请求的资源上不存在’Access Control Allow Origin’标头
原因分析:
1,跨域问题加上@CrossOrigin
我的不是这个问题
@CrossOrigin
public class CrmBannerApiController
2 原来是我的nginx修改配置后没有重新加载配置文件
需要重新加载 或者重启电脑
注意: 重启nginx不行