diff --git a/server/internal/api/exports.go b/server/internal/api/exports.go index 5b1efcd..2e7e09d 100644 --- a/server/internal/api/exports.go +++ b/server/internal/api/exports.go @@ -1574,3 +1574,18 @@ func pickFirst(perm map[string]interface{}, filters map[string]interface{}, keys } return nil, false } + +// parseIntVal 尝试将字符串解析为整数,失败返回-1 +func parseIntVal(s string) int { + if s == "" { + return -1 + } + n := 0 + for _, c := range s { + if c < '0' || c > '9' { + return -1 + } + n = n*10 + int(c-'0') + } + return n +}