From 6aac058be741cc1468f2d3e8a43ed8e36add7c1b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 19 Jul 2024 23:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E5=85=A8=E5=B1=80=EF=BC=9A=E5=A4=84=E7=90=86=20HttpRe?= =?UTF-8?q?questMethodNotSupportedException=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/core/handler/GlobalExceptionHandler.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java index 58486f4ed7..6ae7244781 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java @@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; import org.springframework.web.servlet.NoHandlerFoundException; -import org.springframework.web.servlet.resource.NoResourceFoundException; import javax.servlet.http.HttpServletRequest; import javax.validation.ConstraintViolation; @@ -88,9 +87,6 @@ public class GlobalExceptionHandler { if (ex instanceof NoHandlerFoundException) { return noHandlerFoundExceptionHandler(request, (NoHandlerFoundException) ex); } - if (ex instanceof NoResourceFoundException) { - return noResourceFoundExceptionHandler(request, (NoResourceFoundException) ex); - } if (ex instanceof HttpRequestMethodNotSupportedException) { return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex); } @@ -180,15 +176,6 @@ public class GlobalExceptionHandler { return CommonResult.error(NOT_FOUND.getCode(), String.format("请求地址不存在:%s", ex.getRequestURL())); } - /** - * 处理 SpringMVC 请求地址不存在 - */ - @ExceptionHandler(NoResourceFoundException.class) - private CommonResult noResourceFoundExceptionHandler(HttpServletRequest req, NoResourceFoundException ex) { - log.warn("[noResourceFoundExceptionHandler]", ex); - return CommonResult.error(NOT_FOUND.getCode(), String.format("请求地址不存在:%s", ex.getResourcePath())); - } - /** * 处理 SpringMVC 请求方法不正确 *