"...java/me/zhengjie/git@ustchcs.com:gujinli1118/eladmin.git" did not exist on "fd9fb2a600cb8436b1f713ddd090fccaa7c031fc"
Commit 83f5627b authored by dqjdda's avatar dqjdda
Browse files

代码优化

parent 905c8c64
......@@ -80,7 +80,10 @@ public class GlobalExceptionHandler {
// 打印堆栈信息
log.error(ThrowableUtil.getStackTrace(e));
String[] str = Objects.requireNonNull(e.getBindingResult().getAllErrors().get(0).getCodes())[1].split("\\.");
String message = str[1] + ":" + e.getBindingResult().getAllErrors().get(0).getDefaultMessage();
String message = e.getBindingResult().getAllErrors().get(0).getDefaultMessage();
if("不能为空".equals(message)){
message = str[1] + ":" + message;
}
return buildResponseEntity(ApiError.error(message));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment