|
|
@ -241,6 +241,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) {
|
|
|
|
public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) {
|
|
|
|
JSONObject apply = sysClientPreMapperMapper.findByUserName(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) {
|
|
|
|
if (apply == null) {
|
|
|
|
sysClientPreMapperMapper.save(applyInfo);
|
|
|
|
sysClientPreMapperMapper.save(applyInfo);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -307,11 +311,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
JSONObject sysAccount = new JSONObject();
|
|
|
|
JSONObject sysAccount = new JSONObject();
|
|
|
|
sysAccount.put("username", apply.getString("username"));
|
|
|
|
sysAccount.put("username", apply.getString("username"));
|
|
|
|
sysAccount.put("display_name", apply.getString("username"));
|
|
|
|
sysAccount.put("display_name", apply.getString("username"));
|
|
|
|
String salt = PasswordUtils.newSalt();
|
|
|
|
sysAccount.put("salt", apply.getString("salt"));
|
|
|
|
sysAccount.put("salt", salt);
|
|
|
|
|
|
|
|
sysAccount.put("role", 1);
|
|
|
|
sysAccount.put("role", 1);
|
|
|
|
sysAccount.put("password_hash", PasswordUtils.hashPwd(apply.getString("password"), salt));
|
|
|
|
sysAccount.put("password_hash", apply.getString("password_hash"));
|
|
|
|
sysAccount.put("password_aes", PasswordUtils.encryptAESPwd(apply.getString("password")));
|
|
|
|
sysAccount.put("password_aes", apply.getString("password_aes"));
|
|
|
|
sysAccount.put("creator", 0);
|
|
|
|
sysAccount.put("creator", 0);
|
|
|
|
sysAccount.put("contact_phone", apply.getString("contact_phone"));
|
|
|
|
sysAccount.put("contact_phone", apply.getString("contact_phone"));
|
|
|
|
sysAccount.put("client_id", clientId);
|
|
|
|
sysAccount.put("client_id", clientId);
|
|
|
|