fix: 修复封装分页 dataList 索引计算错误

This commit is contained in:
joshua
2024-05-16 09:42:56 +00:00
committed by Charles7c
parent 881fd37dd6
commit 3e60197a31

View File

@@ -104,7 +104,7 @@ public class PageResp<L> implements Serializable {
pageResp.setTotal(list.size());
// 对列表数据进行分页
int fromIndex = (page - 1) * size;
int toIndex = page * size + size;
int toIndex = page * size + fromIndex;
if (fromIndex > list.size()) {
pageResp.setList(new ArrayList<>(0));
} else if (toIndex >= list.size()) {