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:
		@@ -53,11 +53,7 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
 | 
				
			|||||||
        if (timeout == NEVER_EXPIRE) {
 | 
					        if (timeout == NEVER_EXPIRE) {
 | 
				
			||||||
            RedisUtils.setCacheObject(key, value);
 | 
					            RedisUtils.setCacheObject(key, value);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            if (RedisUtils.hasKey(key)) {
 | 
					            RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout));
 | 
				
			||||||
                RedisUtils.setCacheObject(key, value, true);
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        CAFFEINE.invalidate(key);
 | 
					        CAFFEINE.invalidate(key);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -134,11 +130,7 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
 | 
				
			|||||||
        if (timeout == NEVER_EXPIRE) {
 | 
					        if (timeout == NEVER_EXPIRE) {
 | 
				
			||||||
            RedisUtils.setCacheObject(key, object);
 | 
					            RedisUtils.setCacheObject(key, object);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            if (RedisUtils.hasKey(key)) {
 | 
					            RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout));
 | 
				
			||||||
                RedisUtils.setCacheObject(key, object, true);
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        CAFFEINE.invalidate(key);
 | 
					        CAFFEINE.invalidate(key);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user