mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
部门管理接口入参检查完善
This commit is contained in:
+6
-1
@@ -135,7 +135,12 @@ public class GlobalExceptionHandler {
|
||||
log.warn("[handleBindException]", ex);
|
||||
FieldError fieldError = ex.getFieldError();
|
||||
assert fieldError != null; // 断言,避免告警
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", fieldError.getRejectedValue()));
|
||||
String defaultMessage = fieldError.getDefaultMessage();
|
||||
if (CharSequenceUtil.isNotEmpty(defaultMessage)) {
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", defaultMessage));
|
||||
} else {
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", fieldError.getRejectedValue()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user