mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-21 22:30:46 +08:00
fix: fix the bug of page limit (#20)
This commit is contained in:
+6
-6
@@ -75,14 +75,14 @@ func ListRules(c *gin.Context) {
|
||||
res []Rule
|
||||
count int64
|
||||
order = c.Query("order")
|
||||
pageSize int
|
||||
pageSize = 10
|
||||
)
|
||||
|
||||
if c.Query("pageSize") == "" {
|
||||
pageSize = 10
|
||||
} else if n, err := strconv.Atoi(c.Query("pageSize")); err == nil {
|
||||
if n <= 0 || n > 100 {
|
||||
pageSize = 10
|
||||
if c.Query("pageSize") != "" {
|
||||
if n, err := strconv.Atoi(c.Query("pageSize")); err == nil {
|
||||
if n > 0 && n < 100 {
|
||||
pageSize = n
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user