|
@ -73,7 +73,7 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
|
userDO.setLoginFailureCount(0);
|
|
|
String password = userDO.getPassword();
|
|
|
if (StringUtils.isEmpty(password)) {
|
|
|
password = userDO.getIdcard().substring(0, 5);
|
|
|
password = userDO.getIdcard().substring(userDO.getIdcard().length()-6,userDO.getIdcard().length());
|
|
|
}
|
|
|
userDO.setPassword(MD5.md5Hex(password + "{" + userDO.getSalt() + "}"));
|
|
|
return userDao.save(userDO);
|
|
@ -92,7 +92,7 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
|
userDO.setLoginFailureCount(0);
|
|
|
String password = userDO.getPassword();
|
|
|
if (StringUtils.isEmpty(password)) {
|
|
|
password = userDO.getMobile().substring(0, 5);
|
|
|
password = userDO.getMobile().substring(userDO.getMobile().length()-6, userDO.getMobile().length());
|
|
|
}
|
|
|
userDO.setPassword(MD5.md5Hex(password + "{" + userDO.getSalt() + "}"));
|
|
|
return userDao.save(userDO);
|
|
@ -272,7 +272,7 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
|
}
|
|
|
JSONObject returnMsg = new JSONObject();
|
|
|
returnMsg.put("username",userDO.getUsername());
|
|
|
returnMsg.put("password",userDO.getSalt());
|
|
|
returnMsg.put("password",userDO.getIdcard().substring(userDO.getIdcard().length()-6,userDO.getIdcard().length()));
|
|
|
result.put("response", ConstantUtils.SUCCESS);
|
|
|
result.put("msg", returnMsg);
|
|
|
return result;
|
|
@ -440,9 +440,32 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
|
result.put("msg","user not exist for id : " + userId);
|
|
|
return result;
|
|
|
}
|
|
|
registerWithIdcard(user);
|
|
|
// registerWithIdcard(user);
|
|
|
String idcard = user.getIdcard();
|
|
|
String mobile = user.getMobile();
|
|
|
String password = null;
|
|
|
|
|
|
if(!StringUtils.isEmpty(password)&&idcard.length()>10){
|
|
|
password = idcard.substring(idcard.length()-6,idcard.length());
|
|
|
}else if(!StringUtils.isEmpty(mobile)&&mobile.length()>=11){
|
|
|
password = mobile.substring(mobile.length()-6,mobile.length());
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isEmpty(password)){
|
|
|
result.put("response", ConstantUtils.FAIL);
|
|
|
result.put("msg","idcard or moblie not exist : " + userId);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
user.setSalt(randomString(5));
|
|
|
user.setEnabled(true);
|
|
|
user.setLocked(false);
|
|
|
user.setLoginFailureCount(0);
|
|
|
user.setPassword(MD5.md5Hex(password + "{" + user.getSalt() + "}"));
|
|
|
userDao.save(user);
|
|
|
|
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
|
result.put("msg", user.getSalt());
|
|
|
result.put("msg", password);
|
|
|
return result;
|
|
|
}
|
|
|
|