| | |
| | | import com.ruoyi.common.utils.redis.RedisUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.Duration; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * Sa-Token持久层接口(使用框架自带RedisUtils实现 协议统一) |
| | |
| | | if (timeout == SaTokenDao.NEVER_EXPIRE) { |
| | | RedisUtils.setCacheObject(key, value); |
| | | } else { |
| | | RedisUtils.setCacheObject(key, value, timeout, TimeUnit.SECONDS); |
| | | RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | return; |
| | | } |
| | | RedisUtils.expire(key, timeout, TimeUnit.SECONDS); |
| | | RedisUtils.expire(key, Duration.ofSeconds(timeout)); |
| | | } |
| | | |
| | | |
| | |
| | | if (timeout == SaTokenDao.NEVER_EXPIRE) { |
| | | RedisUtils.setCacheObject(key, object); |
| | | } else { |
| | | RedisUtils.setCacheObject(key, object, timeout, TimeUnit.SECONDS); |
| | | RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | return; |
| | | } |
| | | RedisUtils.expire(key, timeout, TimeUnit.SECONDS); |
| | | RedisUtils.expire(key, Duration.ofSeconds(timeout)); |
| | | } |
| | | |
| | | |