在laravel流明中添加CORS政策

问题描述

我正在使用第一个带有Lumen后端的ReactJS应用程序。

我已经按照Steps to enable CORS on a Lumen API Backend添加了中间件。

我还使用了composer require barryvdh/laravel-cors

但仍然说

Access to XMLHttpRequest at 'http://localhost/my-api/public' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

在这里想念什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)