fix: 修复修改配额后偶尔没有日志记录的问题

--bug=1003543 --user=刘瑞斌 操作记录-修改配额管理后无日志信息 https://www.tapd.cn/55049933/s/1102300
This commit is contained in:
CaptainB 2022-02-09 16:31:29 +08:00 committed by 刘瑞斌
parent 27b3c88863
commit ae8d22c602
1 changed files with 6 additions and 6 deletions

View File

@ -187,11 +187,11 @@ public class ReflexObjectUtil {
column.setDiffValue(ApiDefinitionDiffUtil.diffResponse(newValue, oldValue));
}
} else {
String newValue = column.getNewValue().toString();
String newValue = Objects.toString(column.getNewValue(), "");
if (StringUtils.isNotEmpty(newValue)) {
column.setNewValue(newValue.replaceAll("\\n", " "));
}
String oldValue = column.getOriginalValue().toString();
String oldValue = Objects.toString(column.getOriginalValue(), "");
if (StringUtils.isNotEmpty(oldValue)) {
column.setOriginalValue(oldValue.replaceAll("\\n", " "));
}
@ -206,15 +206,15 @@ public class ReflexObjectUtil {
return comparedColumns;
}
private static String reviverJson(String str,String key,String option){
private static String reviverJson(String str, String key, String option) {
JSONObject obj = new JSONObject(str);
org.json.JSONArray arr = obj.getJSONArray(key);
for (int i = 0; i < arr.length(); i++) {
String s = arr.getString(i);
if(option.equals(DIFF_ADD)){
s = DIFF_ADD+s;
if (option.equals(DIFF_ADD)) {
s = DIFF_ADD + s;
}
arr.put(i,s);
arr.put(i, s);
}
return obj.toString();
}