chenrui
4 天以前 d241b67a5728d4f2bb0d33e4921229a4bf15e250
src/main/java/com/ruoyi/common/utils/SecurityUtils.java
@@ -20,7 +20,6 @@
 */
public class SecurityUtils
{
    /**
     * 用户ID
     **/
@@ -39,11 +38,11 @@
    /**
     * 获取部门ID
     **/
    public static Long getDeptId()
    public static Long [] getDeptId()
    {
        try
        {
            return getLoginUser().getDeptId();
            return getLoginUser().getDeptIds();
        }
        catch (Exception e)
        {
@@ -146,7 +145,7 @@
    public static boolean hasPermi(Collection<String> authorities, String permission)
    {
        return authorities.stream().filter(StringUtils::hasText)
                .anyMatch(x -> Constants.ALL_PERMISSION.contains(x) || PatternMatchUtils.simpleMatch(x, permission));
                .anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
    }
    /**
@@ -172,6 +171,6 @@
    public static boolean hasRole(Collection<String> roles, String role)
    {
        return roles.stream().filter(StringUtils::hasText)
                .anyMatch(x -> Constants.SUPER_ADMIN.contains(x) || PatternMatchUtils.simpleMatch(x, role));
                .anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
    }
}