From 6cc24dc763c4da6d4105a79b9cf534f23f4af19b Mon Sep 17 00:00:00 2001 From: DoubleH <1402818247@qq.com> Date: 星期六, 06 七月 2024 13:58:26 +0800 Subject: [PATCH] !561 使用封装好的StreamUtils工具类代替项目中的部分stream操作 * refactor : 使用封装好的StreamUtils工具类代替项目中的部分stream操作 --- ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/core/dao/PlusSaTokenDao.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/core/dao/PlusSaTokenDao.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/core/dao/PlusSaTokenDao.java index 0664755..38e12c3 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/core/dao/PlusSaTokenDao.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/core/dao/PlusSaTokenDao.java @@ -2,7 +2,6 @@ import cn.dev33.satoken.dao.SaTokenDao; import cn.dev33.satoken.util.SaFoxUtil; -import cn.hutool.core.lang.Console; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import org.dromara.common.redis.utils.RedisUtils; @@ -54,7 +53,7 @@ } else { RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout)); } - CAFFEINE.put(key, value); + CAFFEINE.invalidate(key); } /** @@ -64,7 +63,7 @@ public void update(String key, String value) { if (RedisUtils.hasKey(key)) { RedisUtils.setCacheObject(key, value, true); - CAFFEINE.put(key, value); + CAFFEINE.invalidate(key); } } @@ -117,7 +116,7 @@ } else { RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout)); } - CAFFEINE.put(key, object); + CAFFEINE.invalidate(key); } /** @@ -127,7 +126,7 @@ public void updateObject(String key, Object object) { if (RedisUtils.hasKey(key)) { RedisUtils.setCacheObject(key, object, true); - CAFFEINE.put(key, object); + CAFFEINE.invalidate(key); } } -- Gitblit v1.9.3