From 48aaee99bb8ef3daa1be1acc48a0ac167e16814e Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 11 Jun 2018 16:51:56 +0800 Subject: [PATCH] fixbug --- .../core/impls/SimpleClientApplyServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 51068c008..6e28c5f25 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 @@ -241,6 +241,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 { @@ -307,11 +311,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { JSONObject sysAccount = new JSONObject(); sysAccount.put("username", apply.getString("username")); sysAccount.put("display_name", apply.getString("username")); - 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);