From 00bf7fd07edc7f23c29c00c1193f55defb88b71d Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期二, 26 十一月 2024 11:24:02 +0800
Subject: [PATCH] 分容组盘 电芯属性获取

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
index 77224e9..394f9de 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
@@ -87,9 +87,11 @@
                     using HttpClient httpClient = new HttpClient();
                     httpClient.Timeout = new TimeSpan(0, 0, 60);
 
-                    foreach (var header in headers)
-                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
-
+                    if (headers != null)
+                    {
+                        foreach (var header in headers)
+                            httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
+                    }
                     result = httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync().Result;
                 }
                 return result;

--
Gitblit v1.9.3