|
...
|
...
|
@@ -9,6 +9,7 @@ use App\Utils\EncryptUtils; |
|
|
|
use App\Utils\LogUtils;
|
|
|
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|
|
|
use Illuminate\Support\Arr;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
use Illuminate\Validation\ValidationException;
|
|
|
|
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
|
...
|
...
|
@@ -127,6 +128,12 @@ class Handler extends ExceptionHandler |
|
|
|
//开启debug 错误原样输出
|
|
|
|
$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
|
...
|
...
|
|