【发布时间】:2019-11-11 21:10:54
【问题描述】:
Access to XMLHttpRequest at 'API_URL' from origin 'http://localhost:8080' 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.
当我运行本地主机系统来访问服务器 API 时。它将生成令牌,而不是我收到上述错误。请帮帮我。
【问题讨论】:
-
您必须在后端启用 CORS。 API 使用哪种框架/语言?
-
ASP.Net API,我只收到来自标头的响应。订阅数据出现错误。
-
This 应该能帮到你
-
但是我的 Angularjs 1.6 相同的 API URL 正在成功运行。怎么样?
-
API 和 angularjs 应用程序是否在同一主机/端口下运行?
标签: angular typescript ionic3