From d24e551894e04a557adbcfffddd5cf0966f38e2f Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期六, 18 九月 2021 18:49:41 +0800 Subject: [PATCH] 修复 全局限流key会多出一个"-" 将其移动到IP后面 去除多余的空格 --- src/main/java/com/ruoyi/framework/security/service/SysLoginService.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java b/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java index b9b737d..a841ce2 100644 --- a/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java +++ b/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java @@ -8,7 +8,7 @@ import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.user.CaptchaException; import com.ruoyi.common.exception.user.CaptchaExpireException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException; @@ -62,7 +62,7 @@ // 楠岃瘉鐮佸紑鍏� if (captchaOnOff) { - validateCapcha(username, code, uuid); + validateCaptcha(username, code, uuid); } // 鐢ㄦ埛楠岃瘉 Authentication authentication = null; @@ -82,7 +82,7 @@ else { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); - throw new CustomException(e.getMessage()); + throw new ServiceException(e.getMessage()); } } AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); @@ -100,7 +100,7 @@ * @param uuid 鍞竴鏍囪瘑 * @return 缁撴灉 */ - public void validateCapcha(String username, String code, String uuid) + public void validateCaptcha(String username, String code, String uuid) { String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; String captcha = redisCache.getCacheObject(verifyKey); -- Gitblit v1.9.3