diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java index 03d0ce57b..62ac4f968 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java @@ -1,5 +1,6 @@ package com.ruoyi.common.core.page; +import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.utils.ServletUtils; /** @@ -40,8 +41,8 @@ public class TableSupport public static PageDomain getPageDomain() { PageDomain pageDomain = new PageDomain(); - pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); - pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); + pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1)); + pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10)); pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java index 0585396c9..70e9b08f4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java @@ -20,12 +20,9 @@ public class PageUtils extends PageHelper PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); - if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) - { - String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); - Boolean reasonable = pageDomain.getReasonable(); - PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); - } + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); } /**