修复fastjson的代码
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user