mirror of https://gitee.com/stylefeng/roses
【7.3.3】图形验证码采用redis缓存 设置过期时间
parent
fee65316df
commit
c3c3a259de
|
@ -50,7 +50,7 @@ public class ImageCaptchaService implements ImageCaptchaApi {
|
||||||
SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
|
SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
|
||||||
String verCode = specCaptcha.text().toLowerCase();
|
String verCode = specCaptcha.text().toLowerCase();
|
||||||
String verKey = IdUtil.simpleUUID();
|
String verKey = IdUtil.simpleUUID();
|
||||||
cacheOperatorApi.put(verKey, verCode);
|
cacheOperatorApi.put(verKey, verCode, 120L);
|
||||||
return ImageCaptcha.builder().verImage(specCaptcha.toBase64()).verKey(verKey).build();
|
return ImageCaptcha.builder().verImage(specCaptcha.toBase64()).verKey(verKey).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue