CRSF过期,错误跳转(记录)
//app/Exceptions/Handler.php
public function render($request, Throwable $exception)
{
if (!$request->ajax() && ($exception instanceof TokenMismatchException)) {
return redirect()
->back()
->withErrors('页面已过期,请重新提交') // 可选
->withInput($request->input()); // 可选
}
return parent::render($request, $exception);
}
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: