修复fastjson的代码

This commit is contained in:
2022-05-03 20:08:51 +08:00
parent 4bcf56207d
commit 9bfe05b119
25 changed files with 90 additions and 77 deletions

View File

@@ -1,6 +1,7 @@
package com.yutou.nas.utils;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import java.io.*;
import java.util.HashSet;
@@ -45,7 +46,7 @@ public class ConfigTools {
String src = readFile(file);
if (src != null) {
try {
JSONObject json = JSONObject.parseObject(src);
JSONObject json = JSON.parseObject(src);
return json.getObject(key, t);
} catch (Exception e) {
}
@@ -81,7 +82,7 @@ public class ConfigTools {
if (src == null) {
src = "{}";
}
JSONObject json = JSONObject.parseObject(src);
JSONObject json = JSON.parseObject(src);
json.put(key, data);
saveFile(file, json.toJSONString());
return false;