代码同步

This commit is contained in:
zhangchenhao
2025-05-10 16:45:46 +08:00
parent ad6b3cfa64
commit 8a9d766b50
103 changed files with 967 additions and 762 deletions

View File

@@ -10,6 +10,7 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"time"
)
@@ -50,11 +51,12 @@ 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
}
req, err := http.NewRequest(method, providerConfig["url"]+requestUrl, bytes.NewBuffer(jsonData))
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)
return nil, err