mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-21 21:28:58 +08:00
fix
This commit is contained in:
@@ -51,14 +51,11 @@ func Request1panel(data *map[string]any, method, providerID, requestUrl string)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if providerConfig["url"][len(providerConfig["url"])-1:] != "/" {
|
|
||||||
providerConfig["url"] += "/"
|
|
||||||
}
|
|
||||||
parsedURL, err := url.Parse(providerConfig["url"])
|
parsedURL, err := url.Parse(providerConfig["url"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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))
|
req, err := http.NewRequest(method, baseURL+requestUrl, bytes.NewBuffer(jsonData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// fmt.Println(err)
|
// fmt.Println(err)
|
||||||
|
|||||||
@@ -41,9 +41,6 @@ func RequestBt(data *url.Values, method, providerID, requestUrl string) (map[str
|
|||||||
}
|
}
|
||||||
timestamp := time.Now().Unix()
|
timestamp := time.Now().Unix()
|
||||||
token := generateSignature(fmt.Sprintf("%d", timestamp), providerConfig["api_key"])
|
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_time", fmt.Sprintf("%d", timestamp))
|
||||||
data.Set("request_token", token)
|
data.Set("request_token", token)
|
||||||
@@ -52,7 +49,7 @@ func RequestBt(data *url.Values, method, providerID, requestUrl string) (map[str
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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()))
|
req, err := http.NewRequest(method, baseURL+requestUrl, strings.NewReader(data.Encode()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user