我正在开发一个新组件: demo,按照文档,我的目录结构如图1。我想在该组件中请求本地的一个服务 http://localhost:8080/addData,遇到错误:
Access to XMLHttpRequest at 'http://localhost:8080/addData' from origin 'http://172.18.218.120:3333' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我正在开发一个新组件: demo,按照文档,我的目录结构如图1。我想在该组件中请求本地的一个服务 http://localhost:8080/addData,遇到错误:
Access to XMLHttpRequest at 'http://localhost:8080/addData' from origin 'http://172.18.218.120:3333' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我该如何添加配置文件解决这个问题?