修复关闭验证码时显示问题

This commit is contained in:
阿沐 2023-05-20 23:39:22 +08:00
parent 4889941a78
commit ef6286ec1b
2 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,11 @@ public class SysCaptchaServiceImpl implements SysCaptchaService {
@Override
public SysCaptchaVO generate() {
// 判断是否开启验证码
if (!isCaptchaEnabled()) {
return new SysCaptchaVO();
}
// 生成验证码key
String key = UUID.randomUUID().toString();
@ -44,6 +49,7 @@ public class SysCaptchaServiceImpl implements SysCaptchaService {
SysCaptchaVO captchaVO = new SysCaptchaVO();
captchaVO.setKey(key);
captchaVO.setImage(image);
captchaVO.setEnabled(true);
return captchaVO;
}

View File

@ -21,4 +21,7 @@ public class SysCaptchaVO implements Serializable {
@Schema(description = "image base64")
private String image;
@Schema(description = "是否开启验证码")
private boolean enabled;
}