This commit is contained in:
扶桑花间 2025-09-11 22:17:46 +08:00
parent f4cf916c73
commit b54b8a47a8

View File

@ -51,12 +51,12 @@ class ExceptionHandle extends Handle
public function render($request, Throwable $e): Response
{
// 添加自定义异常处理机制
if ($e instanceof ValidateException) {
return json(['code'=>400,'message'=>$e->getMessage()]);
}
if ($request->isJson()) {
return json(['code'=>400,'message'=>$e->getMessage()]);
}
// if ($e instanceof ValidateException) {
// return json(['code'=>400,'message'=>$e->getMessage()]);
// }
// if ($request->isJson()) {
// return json(['code'=>400,'message'=>$e->getMessage()]);
// }
// 其他错误交给系统处理
return parent::render($request, $e);