English 中文(简体)
CORS政策在REACT中受阻
原标题:blocked by CORS policy in REACT
  • 时间:2024-02-11 00:18:04
  •  标签:
  • reactjs
  • cors

我最近创建了一个反应器,试图将其与后台连接起来,但在提出请求时,它会给西非经共体带来问题。

Problem 1: Access to XMLHttpRequest at https://localhost:7022/Leads/106/status from origin http://localhost:3000 has been blocked by CORS policy: Response to preflight request doesn t pass access control check: It does not have HTTP ok status.

Problem 2: Access to XMLHttpRequest at https://localhost:7022/Leads/1 from origin http://localhost:3000 has been blocked by CORS policy: No Access-Control-Allow-Origin header is present on the requested resource.

我如何解决这些问题?

我研究了一些解决办法,但他们都谈到服务器,反之则掌握了这种控制。

问题回答

前往神学院的网络储存延伸

允许CORS: Access-Control-Allow-Origin

添加

之后,它就跑了。

install it (添加 ) enter image description here https://chromewebstore.google.com/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf?hl=en-US&utm_source=ext_sidebar

“在座的影像描述”/</a

“在座的影像描述”/</a





相关问题
How to fix CORS for Capacitor/Quasar App in a Laravel API

I have an App built on top of Quasar and Capacitor, with an API built on top of Laravel. Everything works well on the dev environment until I build and install the app on my phone, then I keep getting ...

Laravel +Vuejs CORS issue

I am facing a dilemma wit the CORS issue. I have application that is configured as follow: API: https://abc.mydomain.com (laravel) front end: https://subdomain.mydomain.com(VueJS) Both applications ...

Why does CORS not seem to work with POST?

Mozilla s own specification says simple GET or POST should be natively CORS s without preflighting but so far every POST attempt I ve made has resulted in an OPTIONS header going out. When I change ...

热门标签