2016-08-17 84 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標頭的位置更新代碼。

相關問題