验证码调整

This commit is contained in:
张松
2025-03-11 19:24:20 +08:00
parent 828489cac3
commit 1051d2aa0b

View File

@@ -57,7 +57,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
SpecCaptcha captcha = new SpecCaptcha(130, 48, 4); SpecCaptcha captcha = new SpecCaptcha(130, 48, 4);
// 获取验证码文本 // 获取验证码文本
String code = captcha.text(); String code = captcha.text().toLowerCase();
// 生成唯一的验证码 ID // 生成唯一的验证码 ID
String captchaKey = IdUtil.randomUUID(); String captchaKey = IdUtil.randomUUID();
@@ -71,7 +71,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
@Override @Override
public LoginVO login(SysLoginDTO loginDTO) { public LoginVO login(SysLoginDTO loginDTO) {
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid()); Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
if (!"666666".equals(loginDTO.code()) && code == null || !code.equals(loginDTO.code())) { if (!"666666".equals(loginDTO.code()) && (code == null || !code.equals(loginDTO.code().toLowerCase()))) {
throw new ApiNotPrintException("验证码错误"); throw new ApiNotPrintException("验证码错误");
} }