2016-08-17 32 views
0

以下是我的预先要求。Aurelia Fetch CORS不适用于Chrome或Firefox的本地主机

enter image description here

我已经设置了访问控制允许来源,但没有浏览器就可以看到它,因此后续请求失败

这是我则得到了失败的请求

 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/api/v1.0/currencies/2. (Reason: CORS header 'Access-Control-Allow-Origin' missing). 
+0

你能告诉我们'fetch'代码和'cors'代码在哪里设置标题? – Randy

回答

1

您的“访问控制允许来源”设置为“http://localhost:9000”,但您向“http://loclahost:8080”发出请求。鉴于这是Aurelia应用程序,我猜它是通过localhost:9000提供的,因此您需要在设置ACAO标头的位置更新代码。

相关问题