提交 7ccbce20 编写于 作者: minghao.wu's avatar minghao.wu

fix: 设置用户密码

上级 2818113b
流水线 #42951 已取消 于阶段
...@@ -61,7 +61,7 @@ public class PasswordController extends AccountBaseController { ...@@ -61,7 +61,7 @@ public class PasswordController extends AccountBaseController {
String password = request.getPassword(); String password = request.getPassword();
if (!StringUtils.isEmpty(password) && !StringUtils.isEmpty(oldPwd)) { if (!StringUtils.isEmpty(password) && !StringUtils.isEmpty(oldPwd)) {
if (!password.equals(oldPwd)) { if (!password.equals(oldPwd)) {
passwordService.modifyPassword(mobile, oldPwd, password); passwordService.modifyPassword(mobile, oldPwd, password, false);
return PicaResponse.toResponse(); return PicaResponse.toResponse();
} else { } else {
throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_EQUAL); throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_EQUAL);
......
...@@ -13,7 +13,7 @@ public interface PasswordService { ...@@ -13,7 +13,7 @@ public interface PasswordService {
* @param oldPwd 旧密码 * @param oldPwd 旧密码
* @param pwd 新密码 * @param pwd 新密码
*/ */
void modifyPassword(String mobile, String oldPwd, String pwd); void modifyPassword(String mobile, String oldPwd, String pwd, Boolean isForced);
/** /**
* 忘记密码 * 忘记密码
......
...@@ -223,7 +223,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService { ...@@ -223,7 +223,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
/** 修改密码 */ /** 修改密码 */
if (StringUtils.isNotEmpty(req.getPassword()) && StringUtils.isEmpty(accountExist.getPassword())) { if (StringUtils.isNotEmpty(req.getPassword()) && StringUtils.isEmpty(accountExist.getPassword())) {
passwordService.modifyPassword(mobileEncrypt, accountExist.getPassword(), req.getPassword()); passwordService.modifyPassword(mobileEncrypt, accountExist.getPassword(), req.getPassword(), true);
} }
Map map =new HashMap(3); Map map =new HashMap(3);
......
...@@ -59,11 +59,11 @@ public class PasswordServiceImpl implements PasswordService { ...@@ -59,11 +59,11 @@ public class PasswordServiceImpl implements PasswordService {
@Override @Override
@Transactional @Transactional
public void modifyPassword(String mobile, String oldPwd, String pwd) { public void modifyPassword(String mobile, String oldPwd, String pwd, Boolean isForced) {
AccountInfoEntity entity = accountInfoDetailMapper.selectByMobile(mobile); AccountInfoEntity entity = accountInfoDetailMapper.selectByMobile(mobile);
if (entity != null) { if (entity != null) {
//added by joy begin 晓庆说 这批空密码用户不应该在设置密码处 修改密码,提示:引导客户去密码登录; //added by joy begin 晓庆说 这批空密码用户不应该在设置密码处 修改密码,提示:引导客户去密码登录;
if(StringUtil.isEmpty(entity.getPassword())){ if(!isForced && StringUtil.isEmpty(entity.getPassword())){
throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_RESET); throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_RESET);
} }
//added by joy end //added by joy end
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册