mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 20:28:44 +08:00 
			
		
		
		
	【代码优化】全局:userId 为空时,直接校验权限不通过
This commit is contained in:
		@@ -27,7 +27,11 @@ public class SecurityFrameworkServiceImpl implements SecurityFrameworkService {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean hasAnyPermissions(String... permissions) {
 | 
			
		||||
        return permissionApi.hasAnyPermissions(getLoginUserId(), permissions);
 | 
			
		||||
        Long userId = getLoginUserId();
 | 
			
		||||
        if (userId == null) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return permissionApi.hasAnyPermissions(userId, permissions);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -37,7 +41,11 @@ public class SecurityFrameworkServiceImpl implements SecurityFrameworkService {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean hasAnyRoles(String... roles) {
 | 
			
		||||
        return permissionApi.hasAnyRoles(getLoginUserId(), roles);
 | 
			
		||||
        Long userId = getLoginUserId();
 | 
			
		||||
        if (userId == null) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return permissionApi.hasAnyRoles(userId, roles);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user