feat: implement auto add API endpoint
This commit is contained in:
@@ -185,7 +185,14 @@ func getS2AAccountCount() (int, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
req.Header.Set("Authorization", "Bearer "+config.Global.S2AAdminKey)
|
|
||||||
|
// 设置认证头(与代理保持一致)
|
||||||
|
adminKey := config.Global.S2AAdminKey
|
||||||
|
req.Header.Set("Authorization", "Bearer "+adminKey)
|
||||||
|
req.Header.Set("X-API-Key", adminKey)
|
||||||
|
req.Header.Set("X-Admin-Key", adminKey)
|
||||||
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
|
||||||
client := &http.Client{Timeout: 10 * time.Second}
|
client := &http.Client{Timeout: 10 * time.Second}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
|||||||
Reference in New Issue
Block a user