From 235a62c0ef1e3533fdaf9f62e9a14e9aa9974f0c Mon Sep 17 00:00:00 2001 From: chenhouhua Date: Wed, 26 Jun 2024 17:46:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BE=E7=BD=AE=E8=B6=85=E5=87=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=A1=B5=E7=A0=81=E8=8C=83=E5=9B=B4pageNo?= =?UTF-8?q?=EF=BC=8CisLastPage=E7=9A=84=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/pagehelper/PageInfo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/pagehelper/PageInfo.java b/src/main/java/com/github/pagehelper/PageInfo.java index 60f33b0f..36b04793 100644 --- a/src/main/java/com/github/pagehelper/PageInfo.java +++ b/src/main/java/com/github/pagehelper/PageInfo.java @@ -42,6 +42,7 @@ @SuppressWarnings({"rawtypes", "unchecked"}) public class PageInfo extends PageSerializable { public static final int DEFAULT_NAVIGATE_PAGES = 8; + private static final long serialVersionUID = 8444495984368556617L; //private PageInfo EMPTY = new PageInfo(Collections.emptyList(), 0); /** * 当前页 @@ -262,7 +263,7 @@ private void calcPage() { */ private void judgePageBoudary() { isFirstPage = pageNum == 1; - isLastPage = pageNum == pages || pages == 0; + isLastPage = pageNum == pages || pages == 0 || this.size == 0; hasPreviousPage = pageNum > 1; hasNextPage = pageNum < pages; }