hasbeenblockedbyCORSpolic-成都快上网建站

hasbeenblockedbyCORSpolic

Error:

创新互联专注于永康网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供永康营销型网站建设,永康网站制作、永康网页设计、永康网站官网定制、成都小程序开发服务,打造永康网络公司原创品牌,更为您提供永康网站排名全网营销落地服务。

前端访问后端时出现如下报错:

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

解决

安装 CORS Middleware for Laravel. (fruitcake /laravel-cors)

The laravel-cors package allows you to send Cross-Origin Resource Sharing headers with Laravel middleware configuration.

https://github.com/fruitcake/laravel-cors


网页标题:hasbeenblockedbyCORSpolic
网页路径:http://kswjz.com/article/psieio.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流