|
|
@ -176,7 +176,7 @@ public class GlobalExceptionHandler {
|
|
|
|
@ExceptionHandler(MethodArgumentNotValidException.class)
|
|
|
|
@ExceptionHandler(MethodArgumentNotValidException.class)
|
|
|
|
public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
|
|
|
public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
|
|
|
log.error(e.getMessage());
|
|
|
|
log.error(e.getMessage());
|
|
|
|
String message = e.getBindingResult().getFieldError().getDefaultMessage();
|
|
|
|
String message = StreamUtils.join(e.getBindingResult().getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", ");
|
|
|
|
return R.fail(message);
|
|
|
|
return R.fail(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|