Browse Source

优化缓存策略

zhou-hao 7 years ago
parent
commit
65bddff5b5

+ 2 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java

@@ -149,6 +149,8 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
     @Caching(evict = {
             @CacheEvict(value = USER_CACHE_NAME, key = "#userId"),
             @CacheEvict(value = USER_AUTH_CACHE_NAME, key = "#userId"),
+            @CacheEvict(value = USER_AUTH_CACHE_NAME,key = "'user-menu-list:'+#userId"),
+            @CacheEvict(value = USER_AUTH_CACHE_NAME,key = "'menu-tree:'+#userId")
     })
     public void update(String userId, UserEntity userEntity) {
         userEntity.setId(userId);