| | |
| | | import com.ycl.utils.StringUtils; |
| | | import constant.HttpStatus; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.validation.UnexpectedTypeException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.security.access.AccessDeniedException; |
| | |
| | | String message = e.getBindingResult().getFieldError().getDefaultMessage(); |
| | | return AjaxResult.error(message); |
| | | } |
| | | |
| | | /** |
| | | * 参数校验异常 |
| | | */ |
| | | @ExceptionHandler(UnexpectedTypeException.class) |
| | | public AjaxResult handleUnexpectedTypeException(UnexpectedTypeException e) |
| | | { |
| | | log.error(e.getMessage(), e); |
| | | String message = e.getMessage(); |
| | | return AjaxResult.error(message); |
| | | } |
| | | /** |
| | | * 演示模式异常 |
| | | */ |