验证登录取消

This commit is contained in:
xbx 2023-11-14 15:15:30 +08:00
parent e29d8a7e81
commit e1b42a874c
1 changed files with 75 additions and 75 deletions

View File

@ -88,26 +88,26 @@ public class LoginController {
//update-begin--Author:scott Date:20190805 for暂时注释掉密码加密逻辑有点问题 //update-begin--Author:scott Date:20190805 for暂时注释掉密码加密逻辑有点问题
//update-begin-author:taoyan date:20190828 for:校验验证码 //update-begin-author:taoyan date:20190828 for:校验验证码
String captcha = sysLoginModel.getCaptcha(); // String captcha = sysLoginModel.getCaptcha();
if(captcha==null){ // if(captcha==null){
result.error500("验证码无效"); // result.error500("验证码无效");
return result; // return result;
} // }
String lowerCaseCaptcha = captcha.toLowerCase(); // String lowerCaseCaptcha = captcha.toLowerCase();
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906 // //update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
// 加入密钥作为混淆避免简单的拼接被外部利用用户自定义该密钥即可 // // 加入密钥作为混淆避免简单的拼接被外部利用用户自定义该密钥即可
String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret(); // String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
String realKey = Md5Util.md5Encode(origin, "utf-8"); // String realKey = Md5Util.md5Encode(origin, "utf-8");
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906 // //update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
Object checkCode = redisUtil.get(realKey); // Object checkCode = redisUtil.get(realKey);
//当进入登录页时有一定几率出现验证码错误 #1714 // //当进入登录页时有一定几率出现验证码错误 #1714
if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) { // if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
log.warn("验证码错误key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode); // log.warn("验证码错误key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode);
result.error500("验证码错误"); // result.error500("验证码错误");
// 改成特殊的code 便于前端判断 // // 改成特殊的code 便于前端判断
result.setCode(HttpStatus.PRECONDITION_FAILED.value()); // result.setCode(HttpStatus.PRECONDITION_FAILED.value());
return result; // return result;
} // }
//update-end-author:taoyan date:20190828 for:校验验证码 //update-end-author:taoyan date:20190828 for:校验验证码
//1. 校验用户是否有效 //1. 校验用户是否有效
@ -135,7 +135,7 @@ public class LoginController {
//用户登录信息 //用户登录信息
userInfo(sysUser, result); userInfo(sysUser, result);
//update-begin--Author:liusq Date:20210126 for登录成功删除redis中的验证码 //update-begin--Author:liusq Date:20210126 for登录成功删除redis中的验证码
redisUtil.del(realKey); // redisUtil.del(realKey);
//update-begin--Author:liusq Date:20210126 for登录成功删除redis中的验证码 //update-begin--Author:liusq Date:20210126 for登录成功删除redis中的验证码
redisUtil.del(CommonConstant.LOGIN_FAIL + username); redisUtil.del(CommonConstant.LOGIN_FAIL + username);
LoginUser loginUser = new LoginUser(); LoginUser loginUser = new LoginUser();