|
@@ -110,14 +110,14 @@ public class BaseController {
|
|
|
return getResponseData(false, bizException.getCode(), null, bizException.getMessage());
|
|
|
}
|
|
|
|
|
|
- // 默认返回错误码
|
|
|
- return failed(e.getMessage());
|
|
|
- } else if (e instanceof AccessDeniedException) {
|
|
|
- return failed("禁止访问");
|
|
|
- }else if(e instanceof BindException){
|
|
|
- String errors = ((BindException) e).getFieldErrors().stream().map(DefaultMessageSourceResolvable::getDefaultMessage).collect(Collectors.joining("\n"));
|
|
|
- return failed(errors);
|
|
|
- } else if(e instanceof MethodArgumentNotValidException){
|
|
|
+ // 默认返回错误码
|
|
|
+ return failed(e.getMessage());
|
|
|
+ } else if (e instanceof AccessDeniedException) {
|
|
|
+ return failed("禁止访问");
|
|
|
+ }else if(e instanceof BindException){
|
|
|
+ String errors = ((BindException) e).getFieldErrors().stream().map(DefaultMessageSourceResolvable::getDefaultMessage).collect(Collectors.joining("\n"));
|
|
|
+ return failed(errors);
|
|
|
+ } else if(e instanceof MethodArgumentNotValidException){
|
|
|
MethodArgumentNotValidException validException = (MethodArgumentNotValidException) ex;
|
|
|
String errorMsg = validException.getBindingResult()
|
|
|
.getFieldErrors()
|