-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
![验证码]()
+
+
+
+
+
+
+
+
+ {{ countdown > 0 ? `${countdown}秒后重试` : '发送验证码' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![验证码]()
+
+
+
+
+
@@ -81,7 +121,7 @@
+@import './auth.scss';
+
+.send-captcha-btn {
+ margin-right: -5px;
+ min-width: 100px;
+ height: 40px;
+ line-height: 40px;
+ border-radius: 4px;
+ font-size: 14px;
+ background: rgb(87, 120, 255);
+ border: none;
+ padding: 0px;
+
+ &:disabled {
+ background: #c0c4cc;
+ cursor: not-allowed;
+ }
+}
+
From d24419cfb7b10d0b5353897d73f9c35c9b480930 Mon Sep 17 00:00:00 2001
From: hrz <1710360675@qq.com>
Date: Sun, 18 May 2025 17:39:12 +0800
Subject: [PATCH 20/23] =?UTF-8?q?update:=E5=8F=91=E9=80=81=E6=89=8B?=
=?UTF-8?q?=E6=9C=BA=E9=AA=8C=E8=AF=81=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/security/service/impl/CaptchaServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main/manager-api/src/main/java/xiaozhi/modules/security/service/impl/CaptchaServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/security/service/impl/CaptchaServiceImpl.java
index a324c27f4..09c8a1855 100644
--- a/main/manager-api/src/main/java/xiaozhi/modules/security/service/impl/CaptchaServiceImpl.java
+++ b/main/manager-api/src/main/java/xiaozhi/modules/security/service/impl/CaptchaServiceImpl.java
@@ -126,7 +126,7 @@ public class CaptchaServiceImpl implements CaptchaService {
}
// 发送验证码短信
- // smsService.sendVerificationCodeSms(phone, validateCodes);
+ smsService.sendVerificationCodeSms(phone, validateCodes);
}
@Override
From 4d0bef62eda6fc8bfc48dcc7a52a1e8e1bb91a2e Mon Sep 17 00:00:00 2001
From: hrz <1710360675@qq.com>
Date: Sun, 18 May 2025 17:55:18 +0800
Subject: [PATCH 21/23] =?UTF-8?q?update:=E8=A1=A5=E5=85=85=E7=BC=BA?=
=?UTF-8?q?=E5=A4=B1=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../xiaozhi/modules/security/controller/LoginController.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java b/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java
index b8186423d..d0d84e66d 100644
--- a/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java
+++ b/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java
@@ -183,7 +183,7 @@ public class LoginController {
throw new RenException("用户名或验证码错误");
}
// 验证短信验证码是否正常
- boolean validate = captchaService.validateSMSValidateCode(dto.getPhone(), dto.getCode());
+ boolean validate = captchaService.validateSMSValidateCode(dto.getPhone(), dto.getCode(), false);
// 判断是否通过验证
if (!validate) {
throw new RenException("用户名或验证码错误");
From 5bba864faa38ff8f0f33a4f91a5317e969efbe80 Mon Sep 17 00:00:00 2001
From: hrz <1710360675@qq.com>
Date: Sun, 18 May 2025 17:59:08 +0800
Subject: [PATCH 22/23] =?UTF-8?q?fix=EF=BC=9A=E7=99=BB=E5=BD=95=E5=A4=B1?=
=?UTF-8?q?=E8=B4=A5=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main/manager-web/src/views/login.vue | 1 +
1 file changed, 1 insertion(+)
diff --git a/main/manager-web/src/views/login.vue b/main/manager-web/src/views/login.vue
index 407831d16..f082721e0 100644
--- a/main/manager-web/src/views/login.vue
+++ b/main/manager-web/src/views/login.vue
@@ -199,6 +199,7 @@ export default {
this.$store.commit('setToken', JSON.stringify(data.data));
goToPage('/home');
}, (err) => {
+ showDanger(err.data.msg || '登录失败')
if (err.data != null && err.data.msg != null && err.data.msg.indexOf('图形验证码') > -1) {
this.fetchCaptcha()
}
From db68871646b9bb655f71f24284b3664b2007e438 Mon Sep 17 00:00:00 2001
From: hrz <1710360675@qq.com>
Date: Sun, 18 May 2025 22:25:09 +0800
Subject: [PATCH 23/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/exception/RenExceptionHandler.java | 6 +++---
.../modules/sys/loginControllerTest.java | 19 ++++++++++++-------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/main/manager-api/src/main/java/xiaozhi/common/exception/RenExceptionHandler.java b/main/manager-api/src/main/java/xiaozhi/common/exception/RenExceptionHandler.java
index df9023aed..f6b19d313 100644
--- a/main/manager-api/src/main/java/xiaozhi/common/exception/RenExceptionHandler.java
+++ b/main/manager-api/src/main/java/xiaozhi/common/exception/RenExceptionHandler.java
@@ -1,5 +1,8 @@
package xiaozhi.common.exception;
+import java.util.List;
+import java.util.Objects;
+
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.dao.DuplicateKeyException;
@@ -13,8 +16,6 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import xiaozhi.common.utils.Result;
-import java.util.List;
-import java.util.Objects;
/**
* 异常处理器
* Copyright (c) 人人开源 All rights reserved.
@@ -67,7 +68,6 @@ public class RenExceptionHandler {
@ExceptionHandler(MethodArgumentNotValidException.class)
public Result
handleMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
- StringBuilder sb = new StringBuilder();
List allErrors = ex.getBindingResult().getAllErrors();
String errorMsg = allErrors.stream()
.filter(Objects::nonNull)
diff --git a/main/manager-api/src/test/java/xiaozhi/modules/sys/loginControllerTest.java b/main/manager-api/src/test/java/xiaozhi/modules/sys/loginControllerTest.java
index 777abbf9d..5cc39967c 100644
--- a/main/manager-api/src/test/java/xiaozhi/modules/sys/loginControllerTest.java
+++ b/main/manager-api/src/test/java/xiaozhi/modules/sys/loginControllerTest.java
@@ -1,15 +1,16 @@
package xiaozhi.modules.sys;
-import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
+
+import lombok.extern.slf4j.Slf4j;
import xiaozhi.modules.security.controller.LoginController;
import xiaozhi.modules.security.dto.LoginDTO;
+import xiaozhi.modules.security.dto.SmsVerificationDTO;
import xiaozhi.modules.sys.dto.RetrievePasswordDTO;
-
@Slf4j
@SpringBootTest
@ActiveProfiles("dev")
@@ -28,23 +29,27 @@ class loginControllerTest {
}
@Test
- public void testSmsVerification(){
+ public void testSmsVerification() {
try {
- loginController.smsVerification("手机号码");
- }catch (Exception e){
+ SmsVerificationDTO smsVerificationDTO = new SmsVerificationDTO();
+ smsVerificationDTO.setPhone("手机号码");
+ smsVerificationDTO.setCaptchaId("123456");
+ smsVerificationDTO.setCaptcha("123456");
+ loginController.smsVerification(smsVerificationDTO);
+ } catch (Exception e) {
System.out.println(e.getMessage());
}
}
@Test
- public void testRetrievePassword(){
+ public void testRetrievePassword() {
try {
RetrievePasswordDTO retrievePasswordDTO = new RetrievePasswordDTO();
retrievePasswordDTO.setCode("123456");
retrievePasswordDTO.setPhone("手机号码");
retrievePasswordDTO.setPassword("密码");
loginController.retrievePassword(retrievePasswordDTO);
- }catch (Exception e){
+ } catch (Exception e) {
System.out.println(e.getMessage());
}