Browse Source

无JIRA任务 密码加密

master
richie 6 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.host = reader.getAttrAsString("host", StringUtils.EMPTY);
this.port = reader.getAttrAsInt("port", DEFAULT_RPC_PORT); this.port = reader.getAttrAsInt("port", DEFAULT_RPC_PORT);
this.username = reader.getAttrAsString("username", StringUtils.EMPTY); 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") writer.startTAG("Attr")
.attr("host", host) .attr("host", host)
.attr("port", port) .attr("port", port)
.attr("username", username) .attr("username", username);
.attr("password", SecurityToolbox.encrypt(password)) if (StringUtils.isNotEmpty(password)) {
.end(); writer.attr("password", SecurityToolbox.encrypt(password));
}
writer.end();
} }

Loading…
Cancel
Save