【发布时间】:2016-11-03 20:52:37
【问题描述】:
我正在尝试使用 ajax 创建一个 img 上传。 我使用插件 https://github.com/Vinelab/mr-uploader ,我得到 CSRFTokenMismatchException 。 我之前通过在 verifyCsrf 上添加到 $execpet 的路由解决了这个问题
class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'/admin/upload'
];
}
自从第一次解决问题以来,我将整个项目从 laravel 5.1 重新恢复到 laravel 5(长话短说,我不得不这样做) 现在问题出现了。 当尝试向该路由发送发布请求时,我得到“TokenMismatchException”。
【问题讨论】:
-
分享你的ajax代码?还有刀片。
-
ajax 代码是我提到的插件/库的一部分。
-
问题是,即使我试图发送一个裸帖子请求,我也会收到此错误