From b078d88f822cc8d4fe84a1a42d65c58efda9fded Mon Sep 17 00:00:00 2001 From: ningqingsheng <31916341+ningqingsheng@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B9=B6=E5=AE=8C?= =?UTF-8?q?=E5=96=84ReactorUtils.limit()=E6=96=B9=E6=B3=95=20(#436)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jetlinks/community/utils/ReactorUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetlinks-components/common-component/src/main/java/org/jetlinks/community/utils/ReactorUtils.java b/jetlinks-components/common-component/src/main/java/org/jetlinks/community/utils/ReactorUtils.java index dc048c8f3..3d1aae29b 100644 --- a/jetlinks-components/common-component/src/main/java/org/jetlinks/community/utils/ReactorUtils.java +++ b/jetlinks-components/common-component/src/main/java/org/jetlinks/community/utils/ReactorUtils.java @@ -36,10 +36,10 @@ public class ReactorUtils { public static Function, Flux> limit(Long pageIndex, Long pageSize) { - if (pageIndex == null || pageSize == null) { + if (pageIndex == null || pageSize == null || pageIndex < 0 || pageSize <= 0) { return Function.identity(); } - return flux -> flux.skip(pageIndex & pageSize).take(pageSize); + return flux -> flux.skip(pageIndex * pageSize).take(pageSize); } /** @@ -222,4 +222,4 @@ protected SqlFragments createTermFragments(Object trigger, Term term) { } } -} \ No newline at end of file +}