fix(data): 修复分页总数获取逻辑

- 修改 useFetchData 钩子中的分页总数计算方式
- 添加对 data?.total 的备选值支持
- 使用空值合并运算符替代逻辑或运算符提高健壮性
This commit is contained in:
2026-01-19 10:59:18 +08:00
parent 43cd3ba6c8
commit c985fb0f9b

View File

@@ -132,7 +132,7 @@ export default function useFetchData<T>(
setPagination((prev) => ({ setPagination((prev) => ({
...prev, ...prev,
total: data?.totalElements || 0, total: data?.totalElements ?? data?.total ?? 0,
})); }));
let result = []; let result = [];
if (mapDataFunc) { if (mapDataFunc) {