修改分页开始地址

This commit is contained in:
孙小云 2025-03-17 13:32:07 +08:00
parent 21ed04bac5
commit 727d347c71
1 changed files with 2 additions and 2 deletions

View File

@ -10,10 +10,10 @@ public class PageInfo <T> implements Serializable {
public PageInfo(List<T> list,int page,int pageSize) {
this.total = list.size();
this.pageSize = pageSize;
this.pageIndex = page;
this.pageIndex = page ;
// 计算分页数据
int fromIndex = page * pageSize; // 起始索引
int fromIndex = (page - 1) * pageSize; // 起始索引
int toIndex = Math.min(fromIndex + pageSize, total); // 结束索引
// 检查页码是否超出范围