Skip to content

Commit

Permalink
refactor: 将验证码唯一标识格式从无符号 UUID 调整为带符号 UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Aug 14, 2023
1 parent 190385e commit a61196c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CaptchaVO implements Serializable {
/**
* 验证码标识
*/
@Schema(description = "验证码标识", example = "8a5a0296acd141a8b1bd789da867bc1a")
@Schema(description = "验证码标识", example = "090b9a2c-1691-4fca-99db-e4ed0cff362f")
private String uuid;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class LoginRequest implements Serializable {
/**
* 验证码标识
*/
@Schema(description = "验证码标识", example = "8a5a0296acd141a8b1bd789da867bc1a")
@Schema(description = "验证码标识", example = "090b9a2c-1691-4fca-99db-e4ed0cff362f")
@NotBlank(message = "验证码标识不能为空")
private String uuid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public R<CaptchaVO> getImageCaptcha() {
Captcha captcha = captchaImage.getCaptcha();

// 保存验证码
String uuid = IdUtil.fastSimpleUUID();
String uuid = IdUtil.fastUUID();
String captchaKey = RedisUtils.formatKey(CacheConsts.CAPTCHA_KEY_PREFIX, uuid);
RedisUtils.setCacheObject(captchaKey, captcha.text(),
Duration.ofMinutes(captchaImage.getExpirationInMinutes()));
Expand Down

0 comments on commit a61196c

Please sign in to comment.