|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
package com.daqing.financial.hrauth.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.daqing.financial.hrauth.dao.UserLoginDao; |
|
|
|
|
import com.daqing.financial.hrauth.service.UserLoginService; |
|
|
|
@ -53,7 +52,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
public Boolean getBackPwd(UserLoginRequest user){ |
|
|
|
|
//判断重置密码参数是否为空
|
|
|
|
|
if(StringUtils.isEmpty(user.getPhoneAccount())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_ILLEGAL); |
|
|
|
|
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_NOT_EMPTY); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isEmpty(user.getVerifyCode())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.VERIFY_CODE_ILLEGAL); |
|
|
|
@ -62,15 +61,20 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
ExceptionCast.cast(HrmsCode.NEW_PASSWORD_NOT_EMPTY); |
|
|
|
|
} |
|
|
|
|
//校验手机账号是否存在
|
|
|
|
|
int count = this.count(new QueryWrapper<UserEntity>() |
|
|
|
|
.eq("phone_account", user.getPhoneAccount())); |
|
|
|
|
/* int count = this.count(new QueryWrapper<UserEntity>() |
|
|
|
|
.eq("phone_account", user.getPhoneAccount()));*/ |
|
|
|
|
|
|
|
|
|
int count = userLoginDao.selectCount(user.getPhoneAccount()); |
|
|
|
|
if (count == 0) { |
|
|
|
|
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_ILLEGAL); |
|
|
|
|
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_NOT_EMPTY); |
|
|
|
|
} |
|
|
|
|
//判断验证码是否匹配
|
|
|
|
|
|
|
|
|
|
String verify = "123456"; |
|
|
|
|
if(!verify.equals(user.getVerifyCode())){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.VERIFY_CODE_ILLEGAL); |
|
|
|
|
} |
|
|
|
|
//密码格式校验
|
|
|
|
|
Pattern pattern = Pattern.compile("^[a-zA-Z0-9]{8,20}$"); |
|
|
|
|
Pattern pattern = Pattern.compile("^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{6,20}$"); |
|
|
|
|
Matcher match = pattern.matcher(user.getNewPwd()); |
|
|
|
|
if(!match.matches()){ |
|
|
|
|
ExceptionCast.cast(HrmsCode.NEW_PASSWORD_ILLEGAL); |
|
|
|
|