Parcourir la source

带contextpath 完全不可能通过权限

guozx il y a 3 ans
Parent
commit
dd72c50bef

+ 8 - 1
common-user/src/main/java/com/factory/user/service/impl/AuthServiceImpl.java

@@ -69,13 +69,20 @@ public class AuthServiceImpl implements AuthService {
             List<Long> permissionIds = rolePermissions.stream().map(RolePermission::getPermissionId).collect(Collectors.toList());
             if(CollUtil.isNotEmpty(permissionIds)){
                 List<Permission> permissions = permissionMapper.selectBatchIds(permissionIds);
-                boolean hasPermission = permissions.stream().map(Permission::getUrl).anyMatch(p->antMatcher.match(p, requestUrl));
+                boolean hasPermission = permissions.stream().map(Permission::getUrl).anyMatch(p->p.indexOf(requestUrl)>=0);
                 return hasPermission;
             }
         }
         return false;
     }
 
+//    public static void main(String[] args) {
+//         AntPathMatcher antMatcher = new AntPathMatcher();
+//         System.out.println(       antMatcher.match("/web//benteler/fa/getFaPlanListForPad", "/benteler/fa/getFaPlanListForPad"));
+//
+//    }
+///web//benteler/fa/getFaPlanListForPad
+ //   url = "/benteler/fa/getFaPlanListForPad"
     @Override
     public ResponseBean<String> refreshToken(String refreshToken) {