我在使用平台的swagger服务时,在前端调用接口出现了跨域问题,请问应该怎么办?
-
是要进入安装目录再执行指令吗
@小核桃 -
重启了还是报错@小核桃
-
@1134991206 再确认一下etcd的配置里CORS.Enable是否为true,然后单独重启core服务
-
@101025515 访问31000端口是没有经过nginx的,访问ip:3030/rest/core/auth/token试试
-
@101025515 前端也配置一下跨域
-
@101025515 截图看看
-
目前是报这个错误
Access to fetch at 'http://172.41.0.198:3030/rest/core/auth/token?x-request-project=6551b5b259e0436a84d557fc&appkey=a9165f23-9642-4ed3-01f6-7047cda8bdfc&appsecret=1561e7b6-abfb-c487-7904-8b473cb8526f' from origin 'http://172.41.0.236:13813' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.@admin -
@101025515 之前不是回复可以了吗
-
现在报Access to fetch at 'http://172.41.0.198:3030/rest/core/auth/token?x-request-project=6551b5b259e0436a84d557fc&appkey=a9165f23-9642-4ed3-01f6-7047cda8bdfc&appsecret=1561e7b6-abfb-c487-7904-8b473cb8526f' from origin 'http://172.41.0.236:13813' has been blocked by CORS policy: Request header field x-request-project is not allowed by Access-Control-Allow-Headers in preflight response.
@admin