From da32271c8b24c0aba8fda83325c9ceb33e3526c3 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Wed, 3 Jan 2024 23:00:15 +0800 Subject: [PATCH] by --- app/mix/service/scripts_service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/mix/service/scripts_service.go b/app/mix/service/scripts_service.go index 12880828..8bede1ec 100644 --- a/app/mix/service/scripts_service.go +++ b/app/mix/service/scripts_service.go @@ -4,6 +4,7 @@ import ( "os/exec" "service/library/logger" "strconv" + "strings" ) var ( @@ -25,6 +26,9 @@ func (s *ScriptsService) QueryCallCount(url string, logpath string) (count int, logger.Error("could not run command: %v", err) return } - count, err = strconv.Atoi(string(out)) + str := string(out) + str = strings.ReplaceAll(str, "\n", "") + str = strings.ReplaceAll(str, "\r", "") + count, err = strconv.Atoi(str) return }