mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
remove 移除分页合理化参数 使用 MP 全局配置分页溢出
This commit is contained in:
@ -36,11 +36,6 @@ public class PageUtils {
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
private static final String REASONABLE = "reasonable";
|
||||
|
||||
/**
|
||||
* 当前记录起始索引 默认值
|
||||
*/
|
||||
@ -51,11 +46,6 @@ public class PageUtils {
|
||||
*/
|
||||
public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* 分页参数合理化 默认值
|
||||
*/
|
||||
private static final Boolean DEFAULT_REASONABLE = Boolean.TRUE;
|
||||
|
||||
/**
|
||||
* 构建 plus 分页对象
|
||||
* @param <T> domain 实体
|
||||
@ -67,10 +57,8 @@ public class PageUtils {
|
||||
Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE);
|
||||
String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN);
|
||||
String isAsc = ServletUtils.getParameter(IS_ASC);
|
||||
Boolean reasonable = ServletUtils.getParameterToBool(REASONABLE, DEFAULT_REASONABLE);
|
||||
//分页合理化,针对不合理的页码自动处理
|
||||
if (reasonable && pageNum <= 0) {
|
||||
pageNum = 1;
|
||||
if (pageNum <= 0) {
|
||||
pageNum = DEFAULT_PAGE_NUM;
|
||||
}
|
||||
PagePlus<T, K> page = new PagePlus<>(pageNum, pageSize);
|
||||
if (StringUtils.isNotBlank(orderByColumn)) {
|
||||
@ -98,10 +86,8 @@ public class PageUtils {
|
||||
Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE);
|
||||
String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN, defaultOrderByColumn);
|
||||
String isAsc = ServletUtils.getParameter(IS_ASC, defaultIsAsc);
|
||||
Boolean reasonable = ServletUtils.getParameterToBool(REASONABLE, DEFAULT_REASONABLE);
|
||||
//分页合理化,针对不合理的页码自动处理
|
||||
if (reasonable && pageNum <= 0) {
|
||||
pageNum = 1;
|
||||
if (pageNum <= 0) {
|
||||
pageNum = DEFAULT_PAGE_NUM;
|
||||
}
|
||||
// 兼容前端排序类型
|
||||
if ("ascending".equals(isAsc)) {
|
||||
|
Reference in New Issue
Block a user