修复运维修改配置文件的bug

serial
BlueMatthew 1 year ago
parent 375ffaca81
commit c6188faf15

@ -107,7 +107,7 @@ public class JSONUtils {
return false;
}
public static boolean updateJsonProperty(JSONObject jsonObject, String name, int fieldType, JSONObject val) {
public static boolean updateJsonProperty(JSONObject jsonObject, String name, int fieldType, Object val) {
if (name == null) {
return false;
}

@ -93,7 +93,7 @@ public class AppMaster {
@Override
public void run() {
// mMasterUrl = "http://192.168.50.50/mntn/";
// mMasterUrl = "http://192.168.50.100/mntn/";
String masterUrl = mMasterUrl;
@ -210,17 +210,16 @@ public class AppMaster {
JSONArray jsonConfigs = null;
try {
jsonConfigs = jsonObject.getJSONArray("configs");
String path = jsonObject.optString("path", null);
String fileName = jsonObject.optString("fileName", null);
if (jsonConfigs != null) {
for (int idx = 0; idx < jsonConfigs.length(); idx++) {
JSONObject jsonConfig = jsonConfigs.getJSONObject(idx);
String path = jsonConfig.optString("path", null);
String fileName = jsonConfig.optString("fileName", null);
String configName = jsonConfig.optString("cfgName", null);
int fieldType = jsonConfig.optInt("cfgType", 0);
JSONObject val = jsonConfig.optJSONObject("cfgValue");
String configName = jsonConfig.optString("name", null);
int fieldType = jsonConfig.optInt("type", 0);
Object val = jsonConfig.opt("value");
updateConfig(path, fileName, configName, fieldType, val);
}
@ -277,7 +276,7 @@ public class AppMaster {
}
}
private boolean updateConfig(String path, String fileName, String name, int fieldType, JSONObject val) {
private boolean updateConfig(String path, String fileName, String name, int fieldType, Object val) {
if (name == null) {
return false;

Loading…
Cancel
Save