perf:更新用户职位的时候,清除缓存

This commit is contained in:
曾文豪
2024-08-27 13:38:57 +08:00
parent 80ec6d2e3d
commit 0310bd4a15
5 changed files with 15 additions and 10 deletions

View File

@@ -56,7 +56,7 @@ public class RoleAuthorityAspect {
HttpServletRequest request = ServletKit.getRequest();
TokenBean tokenBean = tsTokenConfig.validToken(request, true);
String cacheKey = StrUtil.format(TsAuthorityHandler.CACHE_HAS_AUTHORITY, tokenBean.getRoleId(), tokenBean.getId());
String cacheKey = StrUtil.format(TsAuthorityHandler.CACHE_AUTHORITY, tokenBean.getRoleId(), tokenBean.getId());
List<String> authorityList = StrUtil.split(TsCacheService.of().get(cacheKey), ";")
.stream().filter(StrUtil::isNotEmpty).collect(Collectors.toList());
if (CollUtil.isEmpty(authorityList)) {