From c985fb0f9b7529d103b35524eb3c7ee0ab0a4b9e Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 19 Jan 2026 10:59:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(data):=20=E4=BF=AE=E5=A4=8D=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=80=BB=E6=95=B0=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 useFetchData 钩子中的分页总数计算方式 - 添加对 data?.total 的备选值支持 - 使用空值合并运算符替代逻辑或运算符提高健壮性 --- frontend/src/hooks/useFetchData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/useFetchData.ts b/frontend/src/hooks/useFetchData.ts index d3f112a..39aeb77 100644 --- a/frontend/src/hooks/useFetchData.ts +++ b/frontend/src/hooks/useFetchData.ts @@ -132,7 +132,7 @@ export default function useFetchData( setPagination((prev) => ({ ...prev, - total: data?.totalElements || 0, + total: data?.totalElements ?? data?.total ?? 0, })); let result = []; if (mapDataFunc) {