From dd4e0d0d9c75b5216b08644bfe1333a79f794b58 Mon Sep 17 00:00:00 2001 From: hexq <hexiaoqu@visioninsight.com> Date: 星期六, 20 一月 2024 10:22:34 +0800 Subject: [PATCH] BUGFIX:向下级目录关联通道时,出现“未查询到目录xxx的信息" --- src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java b/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java index dbea741..0333e0d 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java @@ -8,6 +8,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; @@ -43,6 +44,17 @@ return WVPResult.fail(ErrorCode.ERROR400); } + /** + * 榛樿寮傚父澶勭悊 + * @param e 寮傚父 + * @return 缁熶竴杩斿洖缁撴灉 + */ + @ExceptionHandler(HttpRequestMethodNotSupportedException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public WVPResult<String> exceptionHandler(HttpRequestMethodNotSupportedException e) { + return WVPResult.fail(ErrorCode.ERROR400); + } + /** * 鑷畾涔夊紓甯稿鐞嗭紝 澶勭悊controller涓繑鍥炵殑閿欒 -- Gitblit v1.8.0