From 43b6e3d6a3a96e7b759b396df4f141ab105fb6bb Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期五, 05 三月 2021 11:31:58 +0800
Subject: [PATCH] 合并嘉乐代码并测试通过

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

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
old mode 100755
new mode 100644
index 369d632..9776765
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -571,14 +571,7 @@
                             if (mHomeGatewayRes.Count > 0)
                             {
                                 DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
-                                //if (mHomeGatewayRes[0].gatewayStatus)
-                                //{
-                                //    DriverLayer.Control.Ins.GatewayOnline = true;
-                                //}
-                                //else
-                                //{
-                                //    DriverLayer.Control.Ins.GatewayOnline = false;
-                                //}
+                                DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
                                 DB_ResidenceData.Instance.SaveResidenceData();
                                 return revertObj.Code;
                             }
@@ -604,6 +597,8 @@
         /// </summary>
         public string GetGatewayInfo()
         {
+            if (DB_ResidenceData.Instance.HomeGateway == null)
+                return StateCode.NETWORK_ERROR;
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
             d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
@@ -614,10 +609,7 @@
                 var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
                 if (mHomeGatewayRes != null)
                 {
-                    if(mHomeGatewayRes.gatewayStatus)
-                    {
-                        DriverLayer.Control.Ins.GatewayOnline = true;
-                    }
+                    DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
                 }
             }
             return revertObj.Code;
@@ -2154,5 +2146,18 @@
 
         #endregion
 
+        #region 钀ょ煶浜慡DK鐩稿叧鎺ュ彛
+        /// <summary>
+        /// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙�
+        /// </summary>
+        public ResponsePackNew EZGetChildToken()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            //d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0