调用Service的方法:
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public void toExportExcel(HttpServletRequest request, HttpServletResponse response,RequestDemo requestDemo) {
/** 查询接触数据 */
List<RequestDemo> list = demoMapper.query(requestDemo);
}
debug时发现获取到的是方法的第一个参数request,并不是想要的查询参数requestDemo,不属于BaseEntity,所以会不赋值,导致没有拼接SQL语句,权限过滤不生效。
将service的参数顺序调整(查询参数调整到第一个):
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public void toExportExcel(RequestDemo requestDemo, HttpServletRequest request, HttpServletResponse response) {
/** 查询接触数据 */
List<RequestDemo> list = demoMapper.query(requestDemo);
}