From d10739a01484f2a11c61c3060d5a944d432d5d73 Mon Sep 17 00:00:00 2001 From: zhangchenhao Date: Thu, 8 May 2025 18:54:07 +0800 Subject: [PATCH] fix --- backend/internal/cert/deploy/1panel.go | 5 +---- backend/internal/cert/deploy/btpanel.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/backend/internal/cert/deploy/1panel.go b/backend/internal/cert/deploy/1panel.go index a680902..3851622 100644 --- a/backend/internal/cert/deploy/1panel.go +++ b/backend/internal/cert/deploy/1panel.go @@ -51,14 +51,11 @@ func Request1panel(data *map[string]any, method, providerID, requestUrl string) if err != nil { return nil, err } - if providerConfig["url"][len(providerConfig["url"])-1:] != "/" { - providerConfig["url"] += "/" - } parsedURL, err := url.Parse(providerConfig["url"]) if err != nil { return nil, err } - baseURL := fmt.Sprintf("%s://%s", parsedURL.Scheme, parsedURL.Host) + baseURL := fmt.Sprintf("%s://%s/", parsedURL.Scheme, parsedURL.Host) req, err := http.NewRequest(method, baseURL+requestUrl, bytes.NewBuffer(jsonData)) if err != nil { // fmt.Println(err) diff --git a/backend/internal/cert/deploy/btpanel.go b/backend/internal/cert/deploy/btpanel.go index 244207f..a843efe 100644 --- a/backend/internal/cert/deploy/btpanel.go +++ b/backend/internal/cert/deploy/btpanel.go @@ -41,9 +41,6 @@ func RequestBt(data *url.Values, method, providerID, requestUrl string) (map[str } timestamp := time.Now().Unix() token := generateSignature(fmt.Sprintf("%d", timestamp), providerConfig["api_key"]) - if providerConfig["url"][len(providerConfig["url"])-1:] != "/" { - providerConfig["url"] += "/" - } data.Set("request_time", fmt.Sprintf("%d", timestamp)) data.Set("request_token", token) @@ -52,7 +49,7 @@ func RequestBt(data *url.Values, method, providerID, requestUrl string) (map[str if err != nil { return nil, err } - baseURL := fmt.Sprintf("%s://%s", parsedURL.Scheme, parsedURL.Host) + baseURL := fmt.Sprintf("%s://%s/", parsedURL.Scheme, parsedURL.Host) req, err := http.NewRequest(method, baseURL+requestUrl, strings.NewReader(data.Encode())) if err != nil {