查找问题原因

This commit is contained in:
chenshaohua
2026-05-26 23:24:02 +08:00
parent d7fa383cc2
commit 6f9b2af7dd

View File

@@ -3,6 +3,7 @@ package com.ruoyi.framework.aspectj;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.ServletUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
@@ -17,6 +18,8 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.security.context.PermissionContextHolder; import com.ruoyi.framework.security.context.PermissionContextHolder;
import javax.servlet.http.HttpServletRequest;
/** /**
* 数据过滤处理 * 数据过滤处理
* *
@@ -59,6 +62,13 @@ public class DataScopeAspect
@Before("@annotation(controllerDataScope)") @Before("@annotation(controllerDataScope)")
public void doBefore(JoinPoint point, DataScope controllerDataScope) throws Throwable public void doBefore(JoinPoint point, DataScope controllerDataScope) throws Throwable
{ {
HttpServletRequest request = ServletUtils.getRequest();
System.out.println("==================== 数据权限切面触发 ====================");
System.out.println("当前请求URL" + (request == null ? "异步/无请求" : request.getRequestURI()));
System.out.println("触发方法:" + point.getTarget().getClass().getName() + "." + point.getSignature().getName());
System.out.println("当前登录用户:" + SecurityUtils.getLoginUser());
clearDataScope(point); clearDataScope(point);
handleDataScope(point, controllerDataScope); handleDataScope(point, controllerDataScope);
} }