| | |
| | | // break; |
| | | // } |
| | | // TenantContextHolder.setTenant(tenantId); |
| | | |
| | | ClientContextHolder.setClient(clientId); |
| | | String roleCodes = grantedAuthorityList.stream().map(SimpleGrantedAuthority::getAuthority).collect(Collectors.joining(", ")); |
| | | List<SysMenu> menuList = findMenuByRoleCodes(roleCodes); |
| | | /* |
| | | *需求:h端 没有进行配置url的通过,剩下的进行验证 |
| | | * |
| | | */ |
| | | //根据h端进行验证 |
| | | if("hospital".equals(clientId)){ |
| | | if(!menuList.isEmpty()){ |
| | | List<String> collect = menuList.stream().map(SysMenu::getUrl).collect(Collectors.toList()); |
| | | if(collect.contains(requestURI)){ |
| | | for (SysMenu menu : menuList) { |
| | | if (StringUtils.isNotEmpty(menu.getUrl()) && antPathMatcher.match(menu.getUrl(), requestURI)) { |
| | | if (StrUtil.isNotEmpty(menu.getPathMethod())) { |
| | | if(!requestMethod.equalsIgnoreCase(menu.getPathMethod())){ |
| | | continue; |
| | | } |
| | | return requestMethod.equalsIgnoreCase(menu.getPathMethod()); |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | //不在配置menu集合里面的放行 |
| | | return true; |
| | | } |
| | | }else{ |
| | | return true; |
| | | } |
| | | } |
| | | for (SysMenu menu : menuList) { |
| | | if (StringUtils.isNotEmpty(menu.getUrl()) && antPathMatcher.match(menu.getUrl(), requestURI)) { |
| | | if (StrUtil.isNotEmpty(menu.getPathMethod())) { |
| | | if(!requestMethod.equalsIgnoreCase(menu.getPathMethod())){ |
| | | continue; |
| | | } |
| | | return requestMethod.equalsIgnoreCase(menu.getPathMethod()); |
| | | } else { |
| | | return true; |