Skip to content

Commit

Permalink
优化权限缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
dongxuanliang252 authored and dongxuanliang252 committed Jul 31, 2020
1 parent 805875c commit 94ab057
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public void setWinSecurityResourceService(WinSecurityResourceService winSecurity
}

private boolean isAccessAllowed(ServletRequest request, ServletResponse response) throws Exception {
List<WinSecurityResourceDTO> resourceList = cache.get(RESOURCE_CACHE_KEY);
if (CollectionUtils.isEmpty(resourceList)) {
List<WinSecurityResourceDTO> resourceList = null;
if (cache.keys().contains(RESOURCE_CACHE_KEY)) {
resourceList = cache.get(RESOURCE_CACHE_KEY);
} else {
resourceList = winSecurityResourceService.getAllValidAccessResourceList();
cache.put(RESOURCE_CACHE_KEY, resourceList);
log.info("WinSecurityUrlFilter, 时间:{}, 从数据库获取数据", new Date());
Expand Down

0 comments on commit 94ab057

Please sign in to comment.