|
|
|
@ -43,10 +43,10 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 忘记密码 |
|
|
|
|
* 验证手机号及验证码 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Boolean getBackPwd(UserLoginRequest user){ |
|
|
|
|
public UserLoginRequest verifyMobile(UserLoginRequest user){ |
|
|
|
|
//判断重置密码参数是否为空
|
|
|
|
|
if(StringUtils.isEmpty(user.getPhoneAccount())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_NOT_EMPTY); |
|
|
|
@ -54,9 +54,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
if(StringUtils.isEmpty(user.getVerifyCode())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.VERIFY_CODE_ILLEGAL); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isEmpty(user.getNewPwd())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.NEW_PASSWORD_NOT_EMPTY); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//校验手机账号是否存在
|
|
|
|
|
/* int count = this.count(new QueryWrapper<UserEntity>() |
|
|
|
|
.eq("phone_account", user.getPhoneAccount()));*/ |
|
|
|
@ -65,13 +63,33 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
if (count == 0) { |
|
|
|
|
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_NOT_EXIST); |
|
|
|
|
} |
|
|
|
|
//根据手机号查询相关信息
|
|
|
|
|
UserEntity userEntity = baseMapper.selectByPhoneAccount(user.getPhoneAccount()); |
|
|
|
|
//判断验证码是否匹配
|
|
|
|
|
String verify = "123456"; |
|
|
|
|
if(!verify.equals(user.getVerifyCode())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.VERIFY_CODE_ILLEGAL); |
|
|
|
|
} |
|
|
|
|
return user; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 重置密码 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Boolean getBackPwd(UserLoginRequest user){ |
|
|
|
|
//判断重置密码参数是否为空
|
|
|
|
|
if(StringUtils.isEmpty(user.getNewPwd())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.NEW_PASSWORD_NOT_EMPTY); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isEmpty(user.getConfirmPwd())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.CONFIRM_PWD_NOT_EMPTY); |
|
|
|
|
} |
|
|
|
|
if(!user.getConfirmPwd().equals(user.getNewPwd())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.TWICE_PWD_DIFFERENT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//根据手机号查询相关信息
|
|
|
|
|
UserEntity userEntity = baseMapper.selectByPhoneAccount(user.getPhoneAccount()); |
|
|
|
|
|
|
|
|
|
String newMD5 = Md5Util.md5(user.getNewPwd()+userEntity.getId()); |
|
|
|
|
//根据手机号码修改密码
|
|
|
|
|