fix 修复 satoken dao层获取timeout为秒导致丢失毫秒进度问题(临时修复 等satoken官方解决)
This commit is contained in:
parent
b47798ef19
commit
e36e8f7758
@ -51,7 +51,11 @@ public class PlusSaTokenDao implements SaTokenDao {
|
|||||||
if (timeout == NEVER_EXPIRE) {
|
if (timeout == NEVER_EXPIRE) {
|
||||||
RedisUtils.setCacheObject(key, value);
|
RedisUtils.setCacheObject(key, value);
|
||||||
} else {
|
} else {
|
||||||
RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout));
|
if (RedisUtils.hasKey(key)) {
|
||||||
|
RedisUtils.setCacheObject(key, value, true);
|
||||||
|
} else {
|
||||||
|
RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CAFFEINE.invalidate(key);
|
CAFFEINE.invalidate(key);
|
||||||
}
|
}
|
||||||
@ -114,7 +118,11 @@ public class PlusSaTokenDao implements SaTokenDao {
|
|||||||
if (timeout == NEVER_EXPIRE) {
|
if (timeout == NEVER_EXPIRE) {
|
||||||
RedisUtils.setCacheObject(key, object);
|
RedisUtils.setCacheObject(key, object);
|
||||||
} else {
|
} else {
|
||||||
RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout));
|
if (RedisUtils.hasKey(key)) {
|
||||||
|
RedisUtils.setCacheObject(key, object, true);
|
||||||
|
} else {
|
||||||
|
RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CAFFEINE.invalidate(key);
|
CAFFEINE.invalidate(key);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user