From 9af56f878cc3e22d3bce6ab53d67f3753470a7ac Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期五, 14 二月 2025 08:59:22 +0800
Subject: [PATCH] #
---
rsf-server/src/main/java/com/vincent/rsf/server/system/controller/AuthController.java | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/AuthController.java b/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/AuthController.java
index a985253..efef6cd 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/AuthController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/AuthController.java
@@ -8,6 +8,7 @@
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.common.annotation.OperationLog;
import com.vincent.rsf.server.common.config.ConfigProperties;
+import com.vincent.rsf.server.common.domain.BusinessRes;
import com.vincent.rsf.server.common.security.JwtSubject;
import com.vincent.rsf.server.common.service.EmailService;
import com.vincent.rsf.server.common.service.RedisService;
@@ -111,12 +112,14 @@
return R.parse(BaseRes.PARAM);
}
// verify code
- String cacheCode = redisService.getValue(EmailType.REGISTER_VERIFY.toString(), param.getEmail());
- if (Cools.isEmpty(cacheCode)) {
- return R.error("The verification code has expired.");
- }
- if (!cacheCode.equals(param.getCode())) {
- return R.error("The verification code is incorrect.");
+ if (!param.getCode().equals(configProperties.getSecurityCode())) {
+ String cacheCode = redisService.getValue(EmailType.REGISTER_VERIFY.toString(), param.getEmail());
+ if (Cools.isEmpty(cacheCode)) {
+ return R.error("The verification code has expired.");
+ }
+ if (!cacheCode.equals(param.getCode())) {
+ return R.error("The verification code is incorrect.");
+ }
}
// register
@@ -195,7 +198,7 @@
return R.error("Please Login First");
}
if (!userService.comparePassword(userService.getById(userId).getPassword(), param.getOldPassword())) {
- return R.parse("408-The Current Password Was Incorrect");
+ return R.parse(BusinessRes.INVALID_PASSWORD);
}
User user = new User();
user.setId(userId);
--
Gitblit v1.9.1