diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index affcac0e7..8ead31d4c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -242,6 +242,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @Transactional public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) { JSONObject apply = sysClientPreMapperMapper.findByUserName(username); + String salt = PasswordUtils.newSalt(); + applyInfo.put("salt", salt); + applyInfo.put("password_hash", PasswordUtils.hashPwd(apply.getString("password"), salt)); + applyInfo.put("password_aes", PasswordUtils.encryptAESPwd(apply.getString("password"))); if (apply == null) { sysClientPreMapperMapper.save(applyInfo); } else { @@ -323,11 +327,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { JSONObject sysAccount = new JSONObject(); sysAccount.put("username", apply.getString("username")); sysAccount.put("display_name", apply.getString("contact_person")); - String salt = PasswordUtils.newSalt(); - sysAccount.put("salt", salt); + sysAccount.put("salt", apply.getString("salt")); sysAccount.put("role", 1); - sysAccount.put("password_hash", PasswordUtils.hashPwd(apply.getString("password"), salt)); - sysAccount.put("password_aes", PasswordUtils.encryptAESPwd(apply.getString("password"))); + sysAccount.put("password_hash", apply.getString("password_hash")); + sysAccount.put("password_aes", apply.getString("password_aes")); sysAccount.put("creator", 0); sysAccount.put("contact_phone", apply.getString("contact_phone")); sysAccount.put("client_id", clientId);