作者 赵彬吉

update

... ... @@ -111,6 +111,10 @@ class Handler extends ExceptionHandler
$code = $exception->getCode();
}elseif ($exception instanceof BsideGlobalException) {
$code = $exception->getCode();
} elseif ($exception instanceof ValidationException) {
// $code = Code::USER_PARAMS_ERROE();
$code = $exception->getCode();
$message = Arr::first(Arr::first($exception->errors()));
} elseif ($exception instanceof NotFoundHttpException || $exception instanceof MethodNotAllowedHttpException) {
return response('404 Not Found', 404);
} else {
... ... @@ -129,11 +133,6 @@ class Handler extends ExceptionHandler
$debub = config('app.debug');
$message = $debub ? $message : ($code->description ?? $message);
//请求参数错误 输出具体错误信息
if($code == Code::USER_PARAMS_ERROE()){
$message = Arr::first(Arr::first($exception->errors()));
}
$response = [
'code' => $code,
'message' => $message
... ...