From dae426f9d22dabacaa78201414d86e1014992227 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 26 十二月 2019 16:57:58 +0800 Subject: [PATCH] 20191226 --- Crabtree/SmartHome/UI/SimpleControl/MainPage.cs | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs b/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs index 24c4766..ad140ac 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs @@ -173,28 +173,31 @@ MainPage.Loading.Hide (); }); } - new System.Threading.Thread (() => { - requesTime = DateTime.Now; - isShowLoading = true; - while (isShowLoading) { - System.Threading.Thread.Sleep (1000); - if (requesTime == DateTime.MinValue) { - break; - } - if (requesTime.AddSeconds (30) < DateTime.Now) { - Application.RunOnMainThread (Loading.Hide); - isShowLoading = false; - } - } - }) { IsBackground = true }.Start (); + //new System.Threading.Thread (() => { + // requesTime = DateTime.Now; + // isShowLoading = true; + // while (isShowLoading) { + // System.Threading.Thread.Sleep (1000); + // if (requesTime == DateTime.MinValue) { + // break; + // } + // if (requesTime.AddSeconds (30) < DateTime.Now) { + // Application.RunOnMainThread (Loading.Hide); + // isShowLoading = false; + // } + // } + //}) { IsBackground = true }.Start (); #region - urlHead = $"{"https://homeautomation.havells.com"}/WebApi/"; - urlHead = "https://developer.hdlcontrol.com/api/"; - string url = urlHead + methodType; - var webClient = new WebClient (); + if (urlHead == "") { + urlHead = $"{"https://homeautomation.havells.com"}/WebApi/"; + urlHead = "https://developer.hdlcontrol.com/api/"; + } else { + webClient.Headers.Add ("CONTENT-TYPE", "application/json"); + } + string url = urlHead + methodType; if (needHeaders && LoginUser != null) {/* 濡傛灉涓嶉渶瑕侀獙璇乀oken鍙互涓嶇敤浼犲叆 */ webClient.Headers.Add ("Authorization", LoginUser.LoginTokenString); } -- Gitblit v1.8.0