【发布时间】:2021-08-11 16:29:51
【问题描述】:
如果我向后端发送请求,这就是我看到的,我使用的是 Angular 12:
Access to XMLHttpRequest at 'https://commapps.herokuapp.com/auth' from origin 'https://ecstatic-engelbart-897f34.netlify.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
ERROR Em {headers: dm, status: 0, statusText: "Unknown Error", url: "https://commapps.herokuapp.com/auth", ok: false, …}
【问题讨论】:
-
您认为您的后端是否为来自该来源的请求设置了正确的
Access-Control-标头?在没有minimal reproducible example 的情况下,您希望我们做什么?