Merge remote-tracking branch 'origin/bonus-jyy-smart-canteen' into bonus-jyy-smart-canteen

This commit is contained in:
sxu 2025-07-03 13:23:06 +08:00
commit 15d5863132
1 changed files with 11 additions and 0 deletions

View File

@ -8,8 +8,10 @@ import com.bonus.common.core.exception.auth.NotPermissionException;
import com.bonus.common.core.exception.auth.NotRoleException;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.core.web.domain.AjaxResult;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
@ -168,4 +170,13 @@ public class GlobalExceptionHandler
{
return AjaxResult.error("演示模式,不允许操作");
}
/**
* 无效参数异常
*/
@ExceptionHandler(HttpMessageNotReadableException.class)
public AjaxResult handleHttpMessageNotReadableException(HttpMessageNotReadableException e)
{
return AjaxResult.error("参数类型错误");
}
}