From abda8a5571c81053222a3a4acdb3d35f51fc086b Mon Sep 17 00:00:00 2001
From: kyy <3283105747@qq.com>
Date: 星期一, 20 十月 2025 15:27:53 +0800
Subject: [PATCH] 1erp解析接口更改
---
WebApi/Gs.Toolbox/InterfaceUtil.cs | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/WebApi/Gs.Toolbox/InterfaceUtil.cs b/WebApi/Gs.Toolbox/InterfaceUtil.cs
index c40aa81..65bd586 100644
--- a/WebApi/Gs.Toolbox/InterfaceUtil.cs
+++ b/WebApi/Gs.Toolbox/InterfaceUtil.cs
@@ -1,8 +1,9 @@
-锘縰sing System.Net.Cache;
-using System.Net;
-using System.Text;
-using Newtonsoft.Json;
+锘縰sing Newtonsoft.Json;
using System.Data.SqlClient;
+using System.Dynamic;
+using System.Net;
+using System.Net.Cache;
+using System.Text;
namespace Gs.Toolbox;
@@ -38,7 +39,7 @@
request.Method = "POST";
request.ContentType = "application/json";
request.Accept = "*/*";
- request.Timeout = 150000;
+ //request.Timeout = 150000;
request.AllowAutoRedirect = false;
request.ServicePoint.Expect100Continue = false;
HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
@@ -54,6 +55,7 @@
responseStr = reader.ReadToEnd();
reader.Close();
}
+ // LogHelper.Debug(url, "HttpPostErp response:" + param + "锛宺esponse:" + responseStr.ToString());
}
catch (Exception ex)
{
@@ -67,10 +69,11 @@
requestStream = null;
response = null;
}
+ //{"msg":"鎿嶄綔鎴愬姛","code":200,"data":{"number":"CGSL168397","code":"200","id":"268781"}}
if (_rtn != -1)
{
Result _result = JsonConvert.DeserializeObject<Result>(responseStr);
- if ("200".Equals(_result.state))
+ if ("200".Equals(_result.code))
_rtn = 1;
}
sbLog.Append("," + DateTime.Now.ToString() + "缁撴潫鍙戦��");
@@ -102,16 +105,15 @@
return (_rtn, (_rtn > 0 ? strLogGuid : responseStr));
}
}
-
+//{"msg":"鎿嶄綔鎴愬姛","code":200,"data":{"number":"CGSL168397","code":"200","id":"268781"}}
public class Result
{
/// <summary>
/// 200鎴愬姛锛屽惁鍒欏け璐�
/// </summary>
- public string? state { get; set; }
+ ///
+
public string? msg { get; set; }
-
- public string? status { get; set; }
-
- public string? message { get; set; }
+ public string? code { get; set; }
+ // public string? data { get; set; }
}
\ No newline at end of file
--
Gitblit v1.9.3