feat: 移除了不必要的JSON响应返回逻辑

This commit is contained in:
mkm 2024-05-29 09:19:30 +08:00
parent 03625cb601
commit caaac6882c

View File

@ -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());
}