提交 cb834de5 编写于 作者:  Peijun.zhao's avatar Peijun.zhao

修改密码时 老密码null时报错

上级 4786247c
流水线 #32737 已失败 于阶段
in 0 second
...@@ -65,6 +65,7 @@ public enum AccountExceptionEnum { ...@@ -65,6 +65,7 @@ public enum AccountExceptionEnum {
PAT_MEMBER_HAS_BINDED_SELF("216556","该成员已被账户绑定为家庭成员,不需要再次绑定"), PAT_MEMBER_HAS_BINDED_SELF("216556","该成员已被账户绑定为家庭成员,不需要再次绑定"),
PAT_HAS_CREATE_ACCT("216557","初始居民已存在主账户"), PAT_HAS_CREATE_ACCT("216557","初始居民已存在主账户"),
PAT_QUERY_MAX("216558","查询参数过多"), PAT_QUERY_MAX("216558","查询参数过多"),
PICA_PASSWORD_RESET("216559", "空密码用户在个人中心设置密码时报错"),
xxx_xxx("",""); xxx_xxx("","");
......
...@@ -18,6 +18,8 @@ import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants; ...@@ -18,6 +18,8 @@ import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants;
import com.pica.cloud.foundation.encryption.util.EncryptUtils; import com.pica.cloud.foundation.encryption.util.EncryptUtils;
import com.pica.cloud.foundation.redis.ICacheClient; import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.utils.utils.StringUtil; import com.pica.cloud.foundation.utils.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -52,18 +54,19 @@ public class PasswordServiceImpl implements PasswordService { ...@@ -52,18 +54,19 @@ public class PasswordServiceImpl implements PasswordService {
@Autowired @Autowired
private ICacheClient cacheClient; private ICacheClient cacheClient;
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Override @Override
@Transactional @Transactional
public void modifyPassword(String mobile, String oldPwd, String pwd) { public void modifyPassword(String mobile, String oldPwd, String pwd) {
AccountInfoEntity entity = accountInfoDetailMapper.selectByMobile(mobile); AccountInfoEntity entity = accountInfoDetailMapper.selectByMobile(mobile);
if (entity != null) { if (entity != null) {
//added by joy begin 晓庆说 这批空密码用户不应该在设置密码处 修改密码,提示:引导客户去密码登录;
if(StringUtil.isEmpty(entity.getPassword())){ if(StringUtil.isEmpty(entity.getPassword())){
entity.setPassword(""); throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_RESET);
}
if(StringUtil.isEmpty(oldPwd)){
oldPwd = "";
} }
//added by joy end
if (entity.getPassword().equals(oldPwd)) { if (entity.getPassword().equals(oldPwd)) {
Date currentTime = new Date(); Date currentTime = new Date();
AccountInfoEntity accountInfoEntity = new AccountInfoEntity(); AccountInfoEntity accountInfoEntity = new AccountInfoEntity();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册