From 485a01cdec625aadfe308545c0a85ac376ae308f Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 5 Jul 2021 11:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.0.4=E3=80=91=E3=80=90captcha?= =?UTF-8?q?=E3=80=91=E6=9B=B4=E6=96=B0=E9=AA=8C=E8=AF=81=E7=A0=81=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/security/captcha/cache/CaptchaRedisCache.java | 4 ++-- .../kernel/security/starter/CaptchaAutoConfiguration.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel-d-security/security-sdk-captcha/src/main/java/cn/stylefeng/roses/kernel/security/captcha/cache/CaptchaRedisCache.java b/kernel-d-security/security-sdk-captcha/src/main/java/cn/stylefeng/roses/kernel/security/captcha/cache/CaptchaRedisCache.java index ba5a21371..a06b5f158 100644 --- a/kernel-d-security/security-sdk-captcha/src/main/java/cn/stylefeng/roses/kernel/security/captcha/cache/CaptchaRedisCache.java +++ b/kernel-d-security/security-sdk-captcha/src/main/java/cn/stylefeng/roses/kernel/security/captcha/cache/CaptchaRedisCache.java @@ -34,9 +34,9 @@ import org.springframework.data.redis.core.RedisTemplate; * @author chenjinlong * @date 2021/1/15 13:44 */ -public class CaptchaRedisCache extends AbstractRedisCacheOperator { +public class CaptchaRedisCache extends AbstractRedisCacheOperator { - public CaptchaRedisCache(RedisTemplate redisTemplate) { + public CaptchaRedisCache(RedisTemplate redisTemplate) { super(redisTemplate); } diff --git a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CaptchaAutoConfiguration.java b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CaptchaAutoConfiguration.java index 1a976d0d4..7ecfcc856 100644 --- a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CaptchaAutoConfiguration.java +++ b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CaptchaAutoConfiguration.java @@ -26,7 +26,6 @@ package cn.stylefeng.roses.kernel.security.starter; import cn.hutool.cache.CacheUtil; import cn.hutool.cache.impl.TimedCache; -import cn.stylefeng.roses.kernel.cache.api.constants.CacheConstants; import cn.stylefeng.roses.kernel.security.api.CaptchaApi; import cn.stylefeng.roses.kernel.security.captcha.CaptchaService; import cn.stylefeng.roses.kernel.security.captcha.cache.CaptchaMemoryCache; @@ -52,7 +51,8 @@ public class CaptchaAutoConfiguration { @Bean @ConditionalOnMissingBean(CaptchaApi.class) public CaptchaApi captchaApi() { - TimedCache timedCache = CacheUtil.newTimedCache(CacheConstants.NONE_EXPIRED_TIME); + // 验证码过期时间 120秒 + TimedCache timedCache = CacheUtil.newTimedCache(1000 * 120); CaptchaMemoryCache captchaMemoryCache = new CaptchaMemoryCache(timedCache); return new CaptchaService(captchaMemoryCache); }