权限同步一级缓存加保护

Signed-off-by: orange-form <3510245832@qq.com>
This commit is contained in:
orange-form
2024-09-12 07:38:20 +00:00
committed by Gitee
parent 8a888a103e
commit 29f241e28d

View File

@@ -271,7 +271,7 @@ public class SaTokenUtil {
Cache cache = cacheManager.getCache(CacheConfig.CacheEnum.USER_PERMISSION_CACHE.name());
Assert.notNull(cache, "Cache USER_PERMISSION_CACHE can't be NULL.");
Cache.ValueWrapper wrapper = cache.get(permKey);
if (wrapper == null) {
if (wrapper == null || CollUtil.isEmpty((Set<String>) wrapper.get())) {
RSet<String> permSet = redissonClient.getSet(permKey);
localPermSet = permSet.readAll();
cache.put(permKey, localPermSet);