From caaac6882c6dd12339ce9eae238359172104a042 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 29 May 2024 09:19:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E4=BA=86=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84JSON=E5=93=8D=E5=BA=94=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ExceptionHandler.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/ExceptionHandler.php b/app/ExceptionHandler.php index 25cce4e..08558f7 100644 --- a/app/ExceptionHandler.php +++ b/app/ExceptionHandler.php @@ -20,10 +20,6 @@ class ExceptionHandler extends Handler if ($exception instanceof Dumper) { return \response(self::convertToHtml($exception)); } - // json请求返回json数据 - if ($request->expectsJson()) { - return json(['code' => $exception->getCode() ?: 500, 'msg' => $exception->getMessage(), 'show' => 1]); - } // 非json请求则返回一个页面 return new Response(200, [], $exception->getMessage()); }