Merge remote-tracking branch 'origin/dev' into dev-zzx

This commit is contained in:
YAS\29473
2025-04-14 17:02:17 +08:00
7 changed files with 79 additions and 35 deletions

View File

@@ -134,10 +134,18 @@ public class MemberService {
if (StringUtils.isEmpty(captchaCode)) {
throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_TIMEOUT_ERROR);
}
// 如果缓存中有,但与实际不一致,则为验证码错误
if (!StringUtils.equals(captchaCode, dto.getVerificationCode())) {
// 获取通用验证码
String commonCaptchaCode = redisCache.getCacheObject(CacheConstants.SMS_COMMON_VERIFICATION_CODE_KEY + dto.getMobileNumber());
// 缓存中的验证码或者通用验证码, 两个都不匹配, 则抛出异常
if (!StringUtils.equals(captchaCode, dto.getVerificationCode()) && !StringUtils.equals(commonCaptchaCode, dto.getVerificationCode())) {
throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_ERROR);
}
// 如果缓存中有,但与实际不一致,则为验证码错误
// if (!StringUtils.equals(captchaCode, dto.getVerificationCode())) {
// throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_ERROR);
// }
}
/**