正常json文件无法打开的处理

This commit is contained in:
446052889@qq.com 2023-02-15 15:24:41 +08:00
parent 899a7e6e56
commit 63b1b82e36
3 changed files with 8 additions and 7 deletions

View File

@ -124,13 +124,16 @@ public class CoeDesignerDefaultDao {
}
model.setDefinition(define);
JSONObject definition = new JSONObject();
try {
JSONObject definition = JSONObject.parseObject(define);
definition = JSONObject.parseObject(model.getDefinition());
} catch (Exception e) {
e.printStackTrace();
/*System.out.println("-----------错误信息输出Start-----------");
SDK.getLogAPI().consoleErr(define);
System.out.println("-----------错误信息输出End-----------");*/
System.out.println("-----------错误信息输出Start-----------");
// 数据源
SDK.getLogAPI().consoleErr("model.getDefinition():" + model.getDefinition());
SDK.getLogAPI().consoleErr("definition.toString():" + definition.toString());
System.out.println("-----------错误信息输出End-----------");
}

View File

@ -296,9 +296,7 @@ public class CoeDesignerUtil {
* @return
*/
public static String getUpdateTime(String jsonObj) {
com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(jsonObj);
// JSONObject json = JSONObject.fromObject(jsonObj);
// return json.optString("updateTime");
JSONObject json = JSONObject.parseObject(jsonObj);
if (json.containsKey("updateTime")) {
return json.getString("updateTime");
}