feat: 去除登录验证码限制
This commit is contained in:
+13
-14
@@ -83,17 +83,19 @@ public class LoginServiceImpl implements ILoginService {
|
||||
return Results.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
||||
}
|
||||
|
||||
String captcha = sysLoginModel.getCaptcha();
|
||||
if(captcha==null){
|
||||
return Results.error("验证码无效");
|
||||
}
|
||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
||||
Object checkCode = redisUtil.get(realKey);
|
||||
// 验证码前后端比较
|
||||
if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||
return Results.error("验证码错误");
|
||||
}
|
||||
// String captcha = sysLoginModel.getCaptcha();
|
||||
// if(captcha==null){
|
||||
// return Results.error("验证码无效");
|
||||
// }
|
||||
// String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
// String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
||||
// Object checkCode = redisUtil.get(realKey);
|
||||
// // 验证码前后端比较
|
||||
// if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||
// return Results.error("验证码错误");
|
||||
// }
|
||||
// redisUtil.del(realKey);
|
||||
|
||||
|
||||
try {
|
||||
//解密获取密码和用户名
|
||||
@@ -140,9 +142,6 @@ public class LoginServiceImpl implements ILoginService {
|
||||
|
||||
//用户登录信息
|
||||
userInfo(sysUser, result);
|
||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
||||
redisUtil.del(realKey);
|
||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
||||
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||
LoginUser loginUser = new LoginUser();
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
|
||||
Reference in New Issue
Block a user