generated from liutk/owl-admin-base
main
parent
3ec468f499
commit
048f2f4ecc
|
|
@ -6,6 +6,7 @@ use Illuminate\Auth\AuthenticationException;
|
|||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
|
@ -39,6 +40,8 @@ class Handler extends ExceptionHandler
|
|||
if ($request->ajax() || $request->wantsJson()) {
|
||||
return response()->json(['data'=>null,'code'=>401 , 'message' => '无效凭证,请先登录' ], 401);
|
||||
}
|
||||
}elseif ($e instanceof NotFoundHttpException) {
|
||||
return response()->json(['data'=>null,'code'=>404 , 'message' => '页面不存在' ], 404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue