提交 89b97cc9 编写于 作者: Chongwen.jiang's avatar Chongwen.jiang

枚举类修改数据类型..

上级 a347d002
流水线 #21873 已失败 于阶段
in 0 second
......@@ -17,9 +17,9 @@ public enum BizTypeRespEnum {
MOBILE_NOT_REGIST(5, "该手机号{mobile}尚未设置密码,请先设置密码。"),
MOBILE_REGISTED(6, "手机号已注册"),
MOBILE_NOT_SETED_PASSWORD(7, "该手机号{mobile}尚未设置密码,请先设置密码。"),
MOBILE_SETED_PASSWORD(8, "手机号设置密码"),
PWD_REG_FALSE(9, "请设置正确的密码格式"),
PWD_REG_TRUE(10, "密码格式正确"),
MOBILE_SETED_PASSWORD(8, "手机号设置密码"),
/*PWD_REG_FALSE(9, "请设置正确的密码格式"),
PWD_REG_TRUE(10, "密码格式正确"),*/
PWD_MATCH_DB(11, "密码正确"),
PWD_MISMATCH_4(12, "密码错误,请重试"),
PWD_MISMATCH_5(13, "密码错误次数过多,请前往找回密码"),
......
......@@ -426,6 +426,10 @@ public class LoginServiceImpl implements LoginService {
String mobile = request.getMobile();
String password = request.getPassword();
if (null == bizType) {
logger.info("bizType is null");
return resp;
}
// 手机号规则校验
if (StringUtils.isNotEmpty(mobile) &&
!ValidateUtils.isMobile(mobile)) {
......@@ -435,10 +439,6 @@ public class LoginServiceImpl implements LoginService {
resp.setBizCode(BizTypeRespEnum.MOBILE_REG_TRUE.getCode());
resp.setBizMsg(BizTypeRespEnum.MOBILE_REG_TRUE.getMsg());
}
if (null == bizType) {
logger.info("bizType is null");
return resp;
}
if (BizTypeEnum.LOGIN_AUTH_CODE.getCode().equals(bizType)) {
// TODO 局域网ip
invokeRCInterface(resp, mobile, ip, deviceId, "");
......@@ -446,19 +446,8 @@ public class LoginServiceImpl implements LoginService {
// 密码登录相关校验
pwdLoginPreValidate(resp, mobile, password);
} else if (BizTypeEnum.FIND_PASSWORD.getCode().equals(bizType)) {
if (StringUtils.isNotEmpty(password)) {
// 判断密码格式是否正确
if (AccountUtils.checkPasswordRule(password)) {
resp.setBizCode(BizTypeRespEnum.PWD_REG_FALSE.getCode());
resp.setBizMsg(BizTypeRespEnum.PWD_REG_FALSE.getMsg());
} else {
resp.setBizMsg(BizTypeRespEnum.PWD_REG_TRUE.getMsg());
resp.setBizCode(BizTypeRespEnum.PWD_REG_TRUE.getCode());
// TODO 局域网ip
invokeRCInterface(resp, mobile, ip, deviceId, "");
}
}
// TODO 局域网ip
invokeRCInterface(resp, mobile, ip, deviceId, "");
} else if (BizTypeEnum.LOGIN_WE_CHAT.getCode().equals(bizType)) {
if(StringUtils.isNotEmpty(mobile)) {
// 判断手机号是否绑定了微信
......@@ -523,20 +512,14 @@ public class LoginServiceImpl implements LoginService {
resp.setBizCode(BizTypeRespEnum.MOBILE_NOT_SETED_PASSWORD.getCode());
resp.setBizMsg(BizTypeRespEnum.MOBILE_NOT_SETED_PASSWORD.getMsg()
.replace("{mobile}", mobile));
}else{
resp.setBizCode(BizTypeRespEnum.MOBILE_SETED_PASSWORD.getCode());
resp.setBizMsg(BizTypeRespEnum.MOBILE_SETED_PASSWORD.getMsg());
}
}
}
if (StringUtils.isNotEmpty(password)) {
// 入参密码格式校验
if (AccountUtils.checkPasswordRule(password)) {
resp.setBizCode(BizTypeRespEnum.PWD_REG_FALSE.getCode());
resp.setBizMsg(BizTypeRespEnum.PWD_REG_FALSE.getMsg());
} else {
resp.setBizCode(BizTypeRespEnum.PWD_REG_TRUE.getCode());
resp.setBizMsg(BizTypeRespEnum.PWD_REG_TRUE.getMsg());
}
/*if (StringUtils.isNotEmpty(password)) {
// 判断密码是否正确
if (StringUtils.isNotEmpty(mobile)) {
AccountInfoEntity accountInfo = accountInfoDetailMapper.selectByMobile(AESUtil.encryptV0(mobile));
......@@ -553,6 +536,8 @@ public class LoginServiceImpl implements LoginService {
resp.setBizCode(BizTypeRespEnum.PWD_MISMATCH_5.getCode());
resp.setBizMsg(BizTypeRespEnum.PWD_MISMATCH_5.getMsg());
}
errorCount = errorCount + 1;
redisClient.set(key, errorCount, Constants.PWD_ERROR_NUM_SECONDS);
}else{
redisClient.set(key, 1, Constants.PWD_ERROR_NUM_SECONDS);
}
......@@ -563,7 +548,7 @@ public class LoginServiceImpl implements LoginService {
}
}
}
}
}*/
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册