angularjs 7 Access-Control-Allow-Origin被cors策略阻止 [英] angularjs 7 Access-Control-Allow-Origin blocked by cors policy
问题描述
在以下位置访问XMLHttpRequest
http://badamirchi.com/wldev/api/Services//SignIn
起源
http://localhost:4200 已被CORS政策阻止:>
Access to XMLHttpRequest at
http://badamirchi.com/wldev/api/Services//SignIn
from origin
http://localhost:4200 has been blocked by CORS policy:
对预检请求的响应未通过访问控制检查:所请求的资源上没有'Access-Control-Allow-Origin'标头.
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
下面是我遇到的问题.
推荐答案
似乎您需要设置更适当的CORS标头,或者您尝试访问的资源不允许本地域访问.您是否使用此服务设置了API密钥?您可能需要将localhost添加到批准的域中(Google AUTH要求这样做)
It looks like eithr you need to set more appropriate CORS headers or the resource you are trying to access doesnt allow localhost domain access. Do you have an API key setup with this service? You may need to add localhost into your approved domains (Google AUTH requires this)
这篇关于angularjs 7 Access-Control-Allow-Origin被cors策略阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!