From b040840222de9d0c7f7375eca43bb155708424e0 Mon Sep 17 00:00:00 2001 From: kylin L <452061493@qq.com> Date: Wed, 19 Jun 2024 17:52:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=99=BB=E5=BD=95=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E9=AA=8C=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/shiro/service/LoginService.java | 10 ++--- .../src/main/resources/templates/login.html | 43 ++++++++++++++++++- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/shiro/service/LoginService.java b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/shiro/service/LoginService.java index 638d64c8..721077bb 100644 --- a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/shiro/service/LoginService.java +++ b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/shiro/service/LoginService.java @@ -41,11 +41,11 @@ public class LoginService public User login(String username, String password) { // 验证码校验 -// if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA))) -// { -// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); -// throw new CaptchaException(); -// } + if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA))) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); + throw new CaptchaException(); + } // 用户名或密码为空 错误 if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) { diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/login.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/login.html index 16db2925..3c5a4d5e 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/login.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/login.html @@ -16,6 +16,28 @@ + + + @@ -31,6 +53,15 @@ 记住密码 +
+
验证码
+ +
+ + + +
+
登录
@@ -59,6 +90,14 @@