From 57e142e160dfa363c72d94bfcf4f7d6544804170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 15 Oct 2024 17:35:41 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E7=89=B9=E6=80=A7?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E8=87=AA=E5=AE=9A=E4=B9=89=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E5=99=A8=E6=8A=A5?= =?UTF-8?q?null=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/web/handler/GlobalExceptionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java index 42c6087ad..321c22615 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java +++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java @@ -176,7 +176,7 @@ public class GlobalExceptionHandler { @ExceptionHandler(MethodArgumentNotValidException.class) public R handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { log.error(e.getMessage()); - String message = e.getBindingResult().getFieldError().getDefaultMessage(); + String message = StreamUtils.join(e.getBindingResult().getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", "); return R.fail(message); }