post()||$request->isAjax())) { $data = [ 'code' => -1, 'message' => "系统异常:".$e->getMessage(), 'timestamp' => time() ]; return json($data); }elseif($e instanceof HttpException){ return view(app()->getRootPath() . 'public/error/error.html'); } // 其他错误交给系统处理 return parent::render($request, $e); } }