From 0ae521a7dc948e3589104f8b48ad49b77ff9d066 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 17 一月 2025 10:42:31 +0800 Subject: [PATCH] update springboot 3.3.5 => 3.4.1 update springdoc 2.7.0 => 2.8.3 update mybatis-plus 3.5.9 => 3.5.10 update hutool 5.8.31 => 5.8.35 update springboot-admin 3.3.4 => 3.4.1 update redisson 3.39.0 => 3.43.0 update mapstruct-plus 1.4.5 => 1.4.6 update lombok 1.18.34 => 1.18.36 update anyline 20241022 => 20250101 update snailjob beta1 => beta1.1 --- ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) 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 56c9e9f..0a60fbc 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 @@ -12,6 +12,7 @@ import org.dromara.common.core.exception.SseException; import org.dromara.common.core.exception.base.BaseException; import org.dromara.common.core.utils.StreamUtils; +import org.dromara.common.json.utils.JsonUtils; import org.springframework.context.support.DefaultMessageSourceResolvable; import org.springframework.validation.BindException; import org.springframework.web.HttpRequestMethodNotSupportedException; @@ -62,8 +63,8 @@ @ExceptionHandler(SseException.class) public String handleNotLoginException(SseException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); - log.error("璇锋眰鍦板潃'{}',璁よ瘉澶辫触'{}',鏃犳硶璁块棶绯荤粺璧勬簮", requestURI, e.getMessage()); - return e.getMessage(); + log.debug("璇锋眰鍦板潃'{}',璁よ瘉澶辫触'{}',鏃犳硶璁块棶绯荤粺璧勬簮", requestURI, e.getMessage()); + return JsonUtils.toJsonString(R.fail(HttpStatus.HTTP_UNAUTHORIZED, "璁よ瘉澶辫触锛屾棤娉曡闂郴缁熻祫婧�")); } /** @@ -175,7 +176,7 @@ @ExceptionHandler(MethodArgumentNotValidException.class) public R<Void> 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); } -- Gitblit v1.9.3