Pre Merge pull request !171 from runphp/N/A

pull/171/MERGE
runphp 3 years ago committed by Gitee
commit 2796e62fc8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -8,6 +8,7 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import com.ruoyi.common.core.constant.HttpStatus;
import com.ruoyi.common.core.exception.DemoModeException;
import com.ruoyi.common.core.exception.InnerAuthException;
@ -61,6 +62,17 @@ public class GlobalExceptionHandler
return AjaxResult.error(e.getMessage());
}
/**
*
*/
@ExceptionHandler(MethodArgumentTypeMismatchException.class)
public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request)
{
String requestURI = request.getRequestURI();
log.error("请求地址'{}',参数'{}'类型错误", requestURI, e.getName());
return AjaxResult.error(e.getMessage());
}
/**
*
*/

Loading…
Cancel
Save