mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	fix 修复 satokenDao 无法更新已存在数据的ttl问题
This commit is contained in:
		@@ -52,13 +52,9 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
 | 
			
		||||
        // 判断是否为永不过期
 | 
			
		||||
        if (timeout == NEVER_EXPIRE) {
 | 
			
		||||
            RedisUtils.setCacheObject(key, value);
 | 
			
		||||
        } else {
 | 
			
		||||
            if (RedisUtils.hasKey(key)) {
 | 
			
		||||
                RedisUtils.setCacheObject(key, value, true);
 | 
			
		||||
        } else {
 | 
			
		||||
            RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout));
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
        CAFFEINE.invalidate(key);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -133,13 +129,9 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
 | 
			
		||||
        // 判断是否为永不过期
 | 
			
		||||
        if (timeout == NEVER_EXPIRE) {
 | 
			
		||||
            RedisUtils.setCacheObject(key, object);
 | 
			
		||||
        } else {
 | 
			
		||||
            if (RedisUtils.hasKey(key)) {
 | 
			
		||||
                RedisUtils.setCacheObject(key, object, true);
 | 
			
		||||
        } else {
 | 
			
		||||
            RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout));
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
        CAFFEINE.invalidate(key);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user