From 531f1380ec8478e109118cf96bc2c9f31e9278d1 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 六月 2021 09:27:23 +0800
Subject: [PATCH] 代码同步

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |   34 ++++++++++++----------------------
 1 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index b059398..c1a0d9e 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -482,7 +482,7 @@
         /// <summary>
         /// 鑾峰彇浣忓畢鍒楄〃
         /// </summary>
-        public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL)
+        public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL,string homeId = "")
         {
             var requestJson = HttpUtil.GetSignRequestJson(new GetHomeListObj() { homeType = homeType.ToString() });
             var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson);
@@ -497,28 +497,17 @@
                 {
                     foreach (var home in homeList)
                     {
-                        //var home = new RegionInfoRes()
-                        //{
-                        //    RegionID = mHome.Id,
-                        //    Name = mHome.homeName,
-                        //    IsOthreShare = mHome.IsOtherShare,
-                        //    accountType = mHome.accountType,
-                        //    isRemoteControl = mHome.isRemoteControl,
-                        //    isBindGateway = mHome.isBindGateway,
-                        //    longitude = mHome.longitude,
-                        //    latitude = mHome.latitude,
-                        //    deliverstatus = mHome.deliverstatus,
-                        //    homeType = mHome.homeType,
-                        //    regionUrl = mHome.regionUrl,
-                        //    emqUrl = mHome.emqUrl,
-                        //    homeRegionName = mHome.homeRegionName,
-                        //    homeRegionId = mHome.homeRegionId,
-                        //    Address = mHome.homeAddress,
-                        //    isAllowCreateScene = mHome.isAllowCreateScene,
-                        //};
                         if (home.isBindGateway)
                         {
                             UserInfo.Current.regionList.Add(home);
+                            //鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹�
+                            if (!string.IsNullOrEmpty(homeId))
+                            {
+                                if (homeId.Contains(home.id))
+                                {
+                                    DB_ResidenceData.Instance.CurrentRegion = home;
+                                }
+                            }
                         }
                     }
                     if(UserInfo.Current.regionList.Count== 0)
@@ -927,8 +916,9 @@
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("debugPerm", debugPerm);
-            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
-            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
+            var jsonString = HttpUtil.GetSignRequestJson(d,d);
+            var pack = HttpUtil.RequestHttpsPost(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
+            return pack;
         }
 
 

--
Gitblit v1.8.0