新版本,代理功能上线

This commit is contained in:
2025-03-07 03:48:59 +08:00
parent 8ead7a7a67
commit b2d9d828e3
130 changed files with 11004 additions and 2209 deletions

View File

@@ -68,7 +68,7 @@ func (w *WestDexService) ProcessRequests(data interface{}, requests []types.West
mutex := sync.Mutex{}
encryptedFields, err := w.EncryptStructFields(data)
if err != nil {
return nil, fmt.Errorf("西部请求, 生成请求数据失败: %+v", err)
return nil, fmt.Errorf("西部请求, 生成请求数据失败: %v", err)
}
ctx, cancel := context.WithCancel(context.Background()) // 创建 context
@@ -135,13 +135,13 @@ func (w *WestDexService) ProcessRequests(data interface{}, requests []types.West
wg.Wait() // 等待所有 goroutine 完成
if errorCount >= errorLimit {
return nil, fmt.Errorf("请求失败次数超过 %d 次: %+v", errorLimit, errorsCh)
return nil, fmt.Errorf("请求失败次数超过 %d 次: %v", errorLimit, errorsCh)
}
// 将 responseData 转换为 JSON
combinedResponse, err := json.Marshal(responseData)
if err != nil {
return nil, fmt.Errorf("响应数据转 JSON 失败: %+v", err)
return nil, fmt.Errorf("响应数据转 JSON 失败: %v", err)
}
return combinedResponse, nil