mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-10 20:57:18 +08:00
fix: 修复封装分页 dataList 索引计算错误
This commit is contained in:
@@ -104,7 +104,7 @@ public class PageResp<L> implements Serializable {
|
|||||||
pageResp.setTotal(list.size());
|
pageResp.setTotal(list.size());
|
||||||
// 对列表数据进行分页
|
// 对列表数据进行分页
|
||||||
int fromIndex = (page - 1) * size;
|
int fromIndex = (page - 1) * size;
|
||||||
int toIndex = page * size + size;
|
int toIndex = page * size + fromIndex;
|
||||||
if (fromIndex > list.size()) {
|
if (fromIndex > list.size()) {
|
||||||
pageResp.setList(new ArrayList<>(0));
|
pageResp.setList(new ArrayList<>(0));
|
||||||
} else if (toIndex >= list.size()) {
|
} else if (toIndex >= list.size()) {
|
||||||
|
Reference in New Issue
Block a user