首页 > 其他 > 详细

has been blocked by CORS policy

时间:2020-02-04 11:54:16      阅读:698      评论:0      收藏:0      [点我收藏+]
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

has been blocked by CORS policy

原文:https://blog.51cto.com/12603214/2469042

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!