From f5268d43584a1f72cb7b19c17232645c24e2348b Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 17 十二月 2020 15:29:31 +0800 Subject: [PATCH] 20201217-3 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 34 +++++++++------------------------- 1 files changed, 9 insertions(+), 25 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 66f61fc..6ff56cb 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -131,31 +131,13 @@ /// 缁戝畾璋冭瘯浜哄憳鎻愪氦鐨勪綇瀹�,涓�涓綇瀹呭彧鑳界粦瀹氫竴娆� /// </summary> /// <returns></returns> - public ResponsePackNew BindingResidence(string strUrl) + public ResponsePackNew BindingResidence(string key) { - try - { - 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; - } + 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); } #region 娉ㄥ唽銆佺櫥褰曢儴鍒� @@ -521,6 +503,7 @@ homeRegionName = mHome.homeRegionName, homeRegionId = mHome.homeRegionId, Address = mHome.homeAddress, + isAllowCreateScene = mHome.isAllowCreateScene, }; UserInfo.Current.regionList.Add(home); } @@ -616,7 +599,7 @@ if (mHomeGatewayRes.Count > 0) { DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0]; - if(mHomeGatewayRes[0].gatewayStatus == "ON_LINE") + if(mHomeGatewayRes[0].gatewayStatus) { //DriverLayer.Control.Ins.IsRemote = true; DriverLayer.Control.Ins.GatewayOnline = true; @@ -2049,6 +2032,7 @@ { d.Add("roomType", GetType); } + d.Add("pageSize", "1000"); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetRoomList, requestJson); -- Gitblit v1.8.0