From 267d5db0c58c088f3ebd793d1e48a66ef6cef998 Mon Sep 17 00:00:00 2001 From: bubu <8096927+bubu-space@user.noreply.gitee.com> Date: Sat, 17 May 2025 03:25:40 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=BF=83=E8=B7=B3=E6=A3=80=E6=B5=8B=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=BF=83=E8=B7=B3=E6=A3=80=E6=B5=8B=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bubu <8096927+bubu-space@user.noreply.gitee.com> --- snowy-web-app/src/main/resources/application.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/snowy-web-app/src/main/resources/application.properties b/snowy-web-app/src/main/resources/application.properties index 7341fe54..35fa6054 100644 --- a/snowy-web-app/src/main/resources/application.properties +++ b/snowy-web-app/src/main/resources/application.properties @@ -84,6 +84,7 @@ spring.datasource.dynamic.druid.validation-query-timeout=2000 spring.datasource.dynamic.druid.test-on-borrow=false spring.datasource.dynamic.druid.test-on-return=false spring.datasource.dynamic.druid.test-while-idle=true +spring.datasource.dynamic.druid.validation-query=SELECT 1 spring.datasource.dynamic.druid.time-between-eviction-runs-millis=6000 spring.datasource.dynamic.druid.min-evictable-idle-time-millis=300000 spring.datasource.dynamic.druid.filters=stat From 834ea2dad9e04cdddf1224d732417fe777925819 Mon Sep 17 00:00:00 2001 From: bubu <8096927+bubu-space@user.noreply.gitee.com> Date: Sat, 17 May 2025 03:29:14 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E6=A0=A1=E9=AA=8C=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E5=86=8D=E4=BB=8Eredis=E7=A7=BB=E9=99=A4=20=E3=80=90?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=80=91=E9=AA=8C=E8=AF=81=E7=A0=81=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=88=90=E5=8A=9F=E5=90=8E=E5=86=8D=E4=BB=8Eredis?= =?UTF-8?q?=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bubu <8096927+bubu-space@user.noreply.gitee.com> --- .../auth/modular/login/service/impl/AuthServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java index 9ab1f3d8..835b8440 100644 --- a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java +++ b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java @@ -331,6 +331,10 @@ public class AuthServiceImpl implements AuthService { if(ObjectUtil.isEmpty(existValidCode)) { throw new CommonException(AuthExceptionEnum.VALID_CODE_ERROR.getValue()); } + // 不一致则直接验证码错误 + if (!validCode.equalsIgnoreCase(Convert.toStr(existValidCode))) { + throw new CommonException("验证码错误"); + } // 移除该验证码 if(ObjectUtil.isEmpty(phoneOrEmail)) { // 图形验证码 @@ -339,10 +343,6 @@ public class AuthServiceImpl implements AuthService { // 手机或者邮箱验证码 commonCacheOperator.remove(AUTH_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo); } - // 不一致则直接验证码错误 - if (!validCode.equalsIgnoreCase(Convert.toStr(existValidCode))) { - throw new CommonException("验证码错误"); - } } /**