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); }