Browse Source

无JIRA任务 密码加密

master
richie 7 years ago
parent
commit
c5bea16bc8
  1. 14
      designer-base/src/com/fr/design/env/RemoteEnvConfig.java

14
designer-base/src/com/fr/design/env/RemoteEnvConfig.java vendored

@ -81,7 +81,10 @@ public class RemoteEnvConfig extends AbstractEnvConfig {
this.host = reader.getAttrAsString("host", StringUtils.EMPTY);
this.port = reader.getAttrAsInt("port", DEFAULT_RPC_PORT);
this.username = reader.getAttrAsString("username", StringUtils.EMPTY);
this.password = SecurityToolbox.decrypt(reader.getAttrAsString("password", StringUtils.EMPTY));
String password = reader.getAttrAsString("password", StringUtils.EMPTY);
if (StringUtils.isNotEmpty(password)) {
this.password = SecurityToolbox.decrypt(password);
}
}
}
}
@ -92,9 +95,12 @@ public class RemoteEnvConfig extends AbstractEnvConfig {
writer.startTAG("Attr")
.attr("host", host)
.attr("port", port)
.attr("username", username)
.attr("password", SecurityToolbox.encrypt(password))
.end();
.attr("username", username);
if (StringUtils.isNotEmpty(password)) {
writer.attr("password", SecurityToolbox.encrypt(password));
}
writer.end();
}

Loading…
Cancel
Save