From 9d5986593e180045f734e75d2092d66aaac086a5 Mon Sep 17 00:00:00 2001 From: lijiarao Date: Mon, 10 Oct 2022 18:02:35 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/LoginController.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java index 7571b960..9834dfc1 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java @@ -93,21 +93,21 @@ public class LoginController { //password = AesEncryptUtil.desEncrypt(sysLoginModel.getPassword().replaceAll("%2B", "\\+")).trim();//密码解密 //update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题 //update-begin-author:taoyan date:20190828 for:校验验证码 - //String captcha = sysLoginModel.getCaptcha(); - //if (captcha == null) { - // result.error500("验证码无效"); - // return result; - //} - //String lowerCaseCaptcha = captcha.toLowerCase(); - //String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), "utf-8"); - //Object checkCode = redisUtil.get(realKey); - ////当进入登录页时,有一定几率出现验证码错误 #1714 - //if (checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) { - // result.error500("验证码错误"); - // return result; - //} else { - // redisUtil.del(realKey); - //} + String captcha = sysLoginModel.getCaptcha(); + if (captcha == null) { + result.error500("验证码无效"); + return result; + } + String lowerCaseCaptcha = captcha.toLowerCase(); + String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), "utf-8"); + Object checkCode = redisUtil.get(realKey); + //当进入登录页时,有一定几率出现验证码错误 #1714 + if (checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) { + result.error500("验证码错误"); + return result; + } else { + redisUtil.del(realKey); + } try { //解密获取密码和用户名 password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);