找回密码

master
shijie 4 years ago
parent c93b5a6c25
commit ba2be1af06
  1. 1
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java
  2. 18
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  3. 3
      dq-govern-gateway/src/main/resources/jwt.properties

@ -1,6 +1,7 @@
package com.daqing.financial.hrauth.controller;
import com.daqing.financial.hrauth.service.UserLoginService;
import com.daqing.framework.domain.hrms.request.LoginRequest;
import com.daqing.framework.domain.hrms.request.UserLoginRequest;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;

@ -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);

@ -1,2 +1 @@
jwt.ignoreUrlList=/api/hrms/employee/list,/apiHrmsAuth/hrms/auth/userlogin/login
jwt.ignoreUrlList=/apiHrmsAuth/getBackPwd,
jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,/apiHrmsAuth/hrms/auth/userlogin/login

Loading…
Cancel
Save