From a7e8f9ea1b9d0b9c8e9c09a8101e65c59a475465 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 09 七月 2020 17:07:31 +0800
Subject: [PATCH] 2020-07-09-01

---
 ZigbeeApp/Shared/Phone/Device/Logic/Send.cs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
old mode 100755
new mode 100644
index da81d33..35b7328
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -1236,12 +1236,16 @@
         /// <param name="method">璇锋眰鏂瑰紡涓篜OST/GET</param>
         /// <param name="second">瓒呮椂鏃堕棿</param>
         /// <returns></returns>
-        public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3)
+        public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3, bool _bool = false)
         {
             HttpWebRequest request = WebRequest.Create(getUrl) as HttpWebRequest; //鍒涘缓璇锋眰
             request.Method = method; //璇锋眰鏂瑰紡涓篜OST/GET
-            request.ContentType = "application/json";
+            request.ContentType = "application/json"; 
             request.Timeout = second * 1000;//瓒呮椂鏃堕棿
+            if (_bool) {
+                //鐢ㄤ簬楂樿儨鍙瀵硅鎺ュ彛
+                request.Headers.Add("Authorization", Config.Instance.Token);
+            }
             if (method == "POST")
             {
                 byte[] jsonbyte = System.Text.Encoding.UTF8.GetBytes(str);
@@ -1360,6 +1364,6 @@
             deviceConditionsInfo.Add(Key, Value);
         }
 
-
+      
     }
 }

--
Gitblit v1.8.0