2 Commits

Author SHA1 Message Date
疯狂的狮子Li
4a637756bb update 优化 isLogin 判断逻辑 2025-07-31 10:20:49 +08:00
疯狂的狮子Li
3f1e97da2b update 优化 PlusSaTokenDao 删除key同步删除本地缓存 2025-07-31 10:20:22 +08:00
2 changed files with 8 additions and 3 deletions

View File

@@ -74,7 +74,9 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
*/
@Override
public void delete(String key) {
RedisUtils.deleteObject(key);
if (RedisUtils.deleteObject(key)) {
CAFFEINE.invalidate(key);
}
}
/**
@@ -151,7 +153,9 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
*/
@Override
public void deleteObject(String key) {
RedisUtils.deleteObject(key);
if (RedisUtils.deleteObject(key)) {
CAFFEINE.invalidate(key);
}
}
/**

View File

@@ -207,7 +207,8 @@ public class LoginHelper {
*/
public static boolean isLogin() {
try {
return getLoginUser() != null;
StpUtil.checkLogin();
return true;
} catch (Exception e) {
return false;
}