Skip to content

Commit

Permalink
4.3.1 - 优化加密方式
Browse files Browse the repository at this point in the history
  • Loading branch information
starmcc committed Mar 27, 2023
1 parent 8748a48 commit 3528624
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/main/java/com/starmcc/beanfun/controller/LoginController.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private void initBasic() {
choiceBoxLoginType.getSelectionModel().select(selectLoginType);
}


private void refeshAccounts() {
ObservableList<String> items = comboBoxAccount.getItems();
items.clear();
Expand Down Expand Up @@ -130,9 +131,7 @@ public void loginAction() {
final Map<String, Double> map = new HashMap<>(16);
String taskName = buildTaskByLoadTips(label, map);
// 执行登录方法
BeanfunStringResult loginResult = BeanfunClient.run().login(
comboBoxAccount.getValue(), passwordFieldPassword.getText(),
process -> map.put("process", process * 100));
BeanfunStringResult loginResult = BeanfunClient.run().login(comboBoxAccount.getValue(), passwordFieldPassword.getText(), process -> map.put("process", process * 100));
AdvancedTimerMamager.getInstance().removeTask(taskName);
if (!loginResult.isSuccess()) {
FrameManager.getInstance().message(loginResult.getMsg(), Alert.AlertType.ERROR);
Expand Down Expand Up @@ -234,14 +233,12 @@ private String getPasswordByAccount(final String act) {
return "";
}
final String key = DataTools.getComputerUniqueId();
Optional<ConfigModel.ActPwd> optional = actPwds.stream()
.filter(actPwd -> {
if (!Objects.equals(QsConstant.config.getLoginType(), actPwd.getType())) {
return false;
}
return StringUtils.equals(AesTools.dncode(key, actPwd.getAct()), act);
})
.findFirst();
Optional<ConfigModel.ActPwd> optional = actPwds.stream().filter(actPwd -> {
if (!Objects.equals(QsConstant.config.getLoginType(), actPwd.getType())) {
return false;
}
return StringUtils.equals(AesTools.dncode(key, actPwd.getAct()), act);
}).findFirst();
return optional.isPresent() ? AesTools.dncode(key, optional.get().getPwd()) : "";
}

Expand Down

0 comments on commit 3528624

Please sign in to comment.