fullUrl() . ",IP:" . getClientIp()); if ($request->ajax()) { return response()->json(['status' => 'fail', 'data' => '', 'message' => 'Page Not Found']); } else { return response()->view('auth.error', ['message' => 'Page Not Found']); } } // 捕获身份校验异常 if ($exception instanceof AuthenticationException) { if ($request->ajax()) { return response()->json(['status' => 'fail', 'data' => '', 'message' => 'Unauthorized']); } else { return response()->view('auth.error', ['message' => 'Unauthorized']); } } // 捕获CSRF异常 if ($exception instanceof TokenMismatchException) { if ($request->ajax()) { return response()->json(['status' => 'fail', 'data' => '', 'message' => 'Refresh Page, Try One More Time']); } else { return response()->view('auth.error', ['message' => 'Refresh Page, Try One More Time']); } } // 捕获反射异常 if ($exception instanceof ReflectionException) { if ($request->ajax()) { return response()->json(['status' => 'fail', 'data' => '', 'message' => 'System Error']); } else { return response()->view('auth.error', ['message' => 'System Error']); } } // 捕获系统错误异常 if ($exception instanceof ErrorException) { if ($request->ajax()) { return response()->json(['status' => 'fail', 'data' => '', 'message' => 'System Error']); } else { return response()->view('auth.error', ['message' => 'System Error, See Logs']); } } return parent::render($request, $exception); } }