liusheng
2025-04-02 acd62c1684cbde71954252ffdf89d0918491e6fc
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
@@ -5,6 +5,7 @@
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.BaseEntity;
@@ -55,6 +56,10 @@
     */
    public static final String DATA_SCOPE = "dataScope";
    @Value("${isAdmin}")
    private  List<Long> isAdmin;
    @Before("@annotation(controllerDataScope)")
    public void doBefore(JoinPoint point, DataScope controllerDataScope) throws Throwable
    {
@@ -70,7 +75,7 @@
        {
            SysUser currentUser = loginUser.getUser();
            // 如果是超级管理员,则不过滤数据
            if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
            if (StringUtils.isNotNull(currentUser) && !isAdmin.contains(loginUser.getUser().getUserId()))
            {
                String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext());
                dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),