【发布时间】:2019-07-09 08:31:16
【问题描述】:
使用 Laravel 5.7 作为后端,使用 Vue.js 作为前端。所以,我需要从 Vue 向 Laravel 后端发送 http 请求。所以,我使用 Laravel CORS 包来使用 github 链接,如下https://github.com/barryvdh/laravel-cors,但它没有成功并且(不将数据传递给表 fron vue)。我的控制台错误是`Cross-Origin Request Blocked: The Same Origin Policy disallows read the remote resource at http://localhost:8000/api/addItem。 (原因:CORS 请求未成功)。
如何解决这个错误?`
【问题讨论】: