1
heshaofeng
2026-03-25 37454e625df68d40897112b2e8c2e3cf4d7163e3
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Util/HttpClientHelper.cs
@@ -9,6 +9,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using WIDESEA_Core.Helper;
namespace WIDESEA_Core.Util
@@ -39,7 +40,7 @@
                SetRequestHeaders(request, config?.Headers);
                return await client.SendAsync(request);
            }, config, $"POST {url}").Result;
            httpResponseResult.ApiUrl = url;
            return httpResponseResult;
        }
@@ -52,6 +53,7 @@
                return await client.SendAsync(request);
            }, config, $"GET {url}").Result;
            httpResponseResult.ApiUrl = url;
            return httpResponseResult;
        }
@@ -84,10 +86,7 @@
            {
                try
                {
                    TResponse? response = JsonSerializer.Deserialize<TResponse>(result.Content, new JsonSerializerOptions
                    {
                        PropertyNameCaseInsensitive = true
                    });
                    TResponse? response = JsonConvert.DeserializeObject<TResponse>(result.Content);
                    if (response != null)
                    {
                        result.Data = response;
@@ -128,10 +127,7 @@
            {
                try
                {
                    TResponse? response = JsonSerializer.Deserialize<TResponse>(result.Content, new JsonSerializerOptions
                    {
                        PropertyNameCaseInsensitive = true
                    });
                    TResponse? response = JsonConvert.DeserializeObject<TResponse>(result.Content);
                    if (response != null)
                    {
                        result.Data = response;
@@ -174,7 +170,8 @@
                    try
                    {
                        response = await requestFunc(client);
                        break;
                        if (response.StatusCode == System.Net.HttpStatusCode.OK)
                            break;
                    }
                    catch (Exception ex) when (retry < config.MaxRetryCount)
                    {