From 01c46e7bfe9aa8fb20b29f70c83c03a307af548a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 22 十二月 2020 16:35:16 +0800
Subject: [PATCH] 2020-12-22 1.更新。
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 43 +++++++++++++++++++++++++++++++++++--------
1 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 6ff56cb..a4d3d4b 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -131,17 +131,40 @@
/// 缁戝畾璋冭瘯浜哄憳鎻愪氦鐨勪綇瀹�,涓�涓綇瀹呭彧鑳界粦瀹氫竴娆�
/// </summary>
/// <returns></returns>
- public ResponsePackNew BindingResidence(string key)
+ public ResponsePackNew BindingResidence(string strUrl)
{
- Dictionary<string, object> d = new Dictionary<string, object>();
- //d.Add("homeId", homeId);
- d.Add("secretKey", key);
- var requestJson = HttpUtil.GetSignRequestJson(d);
- return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_BindlingResidence, requestJson, HttpUtil.GlobalRequestHttpsHost);
+ try
+ {
+ if (strUrl.Contains("app/home/deliver") == false)
+ {
+ //闈炴硶鐨刄RL 杩斿洖涓�涓嚜瀹氫箟鐨勭姸鎬佺爜
+ return new ResponsePackNew() { Code = "-100" };
+ }
+ var client = new RestSharp.RestClient(strUrl);
+
+ var request = new RestSharp.RestRequest(RestSharp.Method.GET);
+ request.Timeout = 5 * 1000;
+ request.AddHeader("content-type", "application/json");
+ request.AddHeader("Authorization", UserInfo.Current.LoginTokenString);
+
+ var response = client.Execute(request);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ return Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch
+ {
+ return null;
+ }
}
#region 娉ㄥ唽銆佺櫥褰曢儴鍒�
-
+
/// <summary>
/// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
@@ -1946,7 +1969,11 @@
d.Add("scenes", new List<Scene>() { scene });
var requestJson = HttpUtil.GetSignRequestJson(d);
- return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddSecne, requestJson);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddSecne, requestJson);
+
+ MainPage.Log($"{pack.Data}");
+
+ return pack;
}
/// <summary>
/// 缂栬緫鍦烘櫙
--
Gitblit v1.8.0