【发布时间】:2019-03-25 09:19:55
【问题描述】:
我已经构建了一个带有 Web-API 调用的服务器端,以从 Angular 应用程序获取数据, 我的注册页面正在获取数据,但它从未到达服务器端, 不断出现以下错误:
跨域请求被阻止:同源策略不允许读取位于http://localhost:58972/api/user/ 的远程资源。 (原因:CORS 预检通道未成功)。[了解详情]
跨域请求被阻止:同源策略不允许读取位于http://localhost:58972/api/user/ 的远程资源。 (原因:CORS 请求未成功)。[了解详情]
错误 Object { headers: {…}, status: 0, statusText: "Unknown Error", url: "http://localhost:58972/api/user/", ok: false, name: "HttpErrorResponse", message: "Http failure response for http://localhost:58972/api/user/: 0 Unknown错误”,错误:错误}
【问题讨论】: