我试图使用我的api和我有一个功能在烬应用程序登录,但当登录行动是琐碎,我收到下面的消息。我收到这个错误的原因是什么?
login:1 Access to fetch at 'https://app-dev.some-url.com.au/api/login' from origin
'http://localhost:4099' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch
the resource with CORS disabled.发布于 2020-08-26 14:19:18
您的API服务器没有配置为接受来自另一个来源的web应用程序的请求。一些备选方案:
OPTIONS请求上为Access-Control-Allow-Origin标头提供服务。如果你懒惰或者事先不知道人们将从哪里来,它可能是Access-Control-Allow-Origin: *。如果不了解API.的详细信息,就很难更具体地说明这一点。
https://stackoverflow.com/questions/63582806
复制相似问题