Reactjs CORS阻止React应用程序获取值

Reactjs CORS阻止React应用程序获取值,reactjs,slim,Reactjs,Slim,所以我有一个带有Slim PHP框架的应用程序,我允许某个端口,但是,发送的头来自localhost:3002,但是NPM从端口3000开始…奇怪吗 API: 显然正因为如此,我的get rquest失败了。有什么想法吗 如果我的npm启动-p3002,它会恢复到3000 Compiled successfully! You can now view mint-apt-finder in the browser. Local: http://localhost:30

所以我有一个带有Slim PHP框架的应用程序,我允许某个端口,但是,发送的头来自localhost:3002,但是NPM从端口3000开始…奇怪吗

API:

显然正因为如此,我的get rquest失败了。有什么想法吗

如果我的npm启动-p3002,它会恢复到3000

Compiled successfully!

You can now view mint-apt-finder in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://'interal-ip':3000

如果您在端口3002(npm start-p 3002)上运行react应用程序会发生什么情况@tadeoheperle我更新了我的问题。它会恢复到端口3000,您使用的是什么react编译器?Next.js?包裹?标准版本?@TadeoHepperle标准版本。如果是关于create react应用程序中的项目,请查看从不同端口开始的正确方式->
Compiled successfully!

You can now view mint-apt-finder in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://'interal-ip':3000