From 1cb2e46cb3f7d55a5e1a3235255828fa6a203f62 Mon Sep 17 00:00:00 2001
From: fuyongxin <110568259@qq.com>
Date: Wed, 03 Jun 2026 14:58:34 +0800
Subject: [PATCH] 修改ruoyi-改为sgd
---
ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java
index bc5fc7f..bee0a3f 100644
--- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java
+++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java
@@ -3,7 +3,7 @@
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
-import javax.annotation.Resource;
+import jakarta.annotation.Resource;
import javax.imageio.ImageIO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -103,20 +103,13 @@
{
throw new CaptchaException("验证码不能为空");
}
- if (StringUtils.isEmpty(uuid))
- {
- throw new CaptchaException("uuid不能为空");
- }
-
- String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
+ String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
String captcha = redisService.getCacheObject(verifyKey);
if (captcha == null)
{
throw new CaptchaException("验证码已失效");
}
-
redisService.deleteObject(verifyKey);
-
if (!code.equalsIgnoreCase(captcha))
{
throw new CaptchaException("验证码错误");
--
Gitblit v1.9.3