From 0eb7cce258f33e258991409ea18aa19212dc96fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=A4=A7?= <1504665037@qq.com> Date: Mon, 26 Jan 2026 15:47:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3500?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=A2=9E=E5=8A=A0BaseContr?= =?UTF-8?q?oller=20getDataTable=20=E7=9A=84=E7=A9=BA=E8=A1=A8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/core/web/controller/BaseController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java index 2bfd8cb..4d54af6 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java @@ -66,7 +66,12 @@ public class BaseController rspData.setCode(HttpStatus.SUCCESS); rspData.setRows(list); rspData.setMsg("查询成功"); - rspData.setTotal(new PageInfo(list).getTotal()); + if (list == null || list.size() == 0) { + rspData.setTotal(0); + } else { + rspData.setTotal(new PageInfo(list).getTotal()); + } + return rspData; }