From e7290281eabcb88d2e430dea9782565474837ce1 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期五, 20 十月 2023 14:29:54 +0800
Subject: [PATCH] Merge branch 'Dev-Branch' into wjc
---
HDL_ON/DAL/Server/HttpUtil.cs | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 14e83b1..b659327 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -22,9 +22,10 @@
public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
const string APP_KEY = "HDL-HOME-APP-TEST";
const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
- //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
- //const string APP_KEY = "CPEVRLRT";
- //const string SECRET_KEY = "CPEVRLSJCPEVRLSZ";
+
+ //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//寮�鍙戠幆澧�
+ //const string APP_KEY = "CPEVRLRT";//寮�鍙戠幆澧傾PP_KEY
+ //const string SECRET_KEY = "CPEVRLSJCPEVRLSZ";//寮�鍙戠幆澧僑ECRET_KEY
/// <summary>
/// RegionMark
/// </summary>
@@ -45,7 +46,6 @@
#endregion
#region **********缃戠粶璇锋眰灏佽**********
-
/// <summary>
/// Get 璇锋眰鏈嶅姟鍣ㄦ柟娉�
/// </summary>
@@ -155,7 +155,7 @@
if(MainPage.NoLoginMode)
{
- return new ResponsePackNew() { Code = "0" };
+ return new ResponsePackNew() { Code = "0" ,Data = "" };
}
#region HttpWebRequest
try
@@ -208,8 +208,8 @@
request.AddUrlSegment(data.Key, data.Value.ToString());
}
}
-
IRestResponse response = client.Execute(request);
+ HDL_ON.Utlis.WriteLine("鍙戦��", requestFullUrl, response.Request.Body?.Value.ToString());
if (response.StatusCode == HttpStatusCode.OK)
{
try
@@ -227,7 +227,7 @@
revertObj.Data = "";
}
//*****涓�浜涘垽绌哄鐞�*****************
-
+ HDL_ON.Utlis.WriteLine("鎺ユ敹", requestFullUrl, response.Content);
return revertObj;
}
catch (Exception ex)
@@ -238,7 +238,19 @@
}
else
{
- HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.ErrorMessage);
+ HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.Content);
+ if(response.Content!= null)
+ {
+ try
+ {
+ var pack = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content);
+ if (pack != null)
+ {
+ return pack;
+ }
+ }
+ catch { }
+ }
return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
}
--
Gitblit v1.8.0