From 60fea1a35f8bfd2eb1399cae05d853b93b3674f9 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 03 一月 2020 13:47:35 +0800
Subject: [PATCH] 2020-01-03 1.增加信mqtt网关设备类型支持。 2.住宅ID改为string类型。
---
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs | 43 ++++++++++++++++++++++++-------------------
1 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs b/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
index 24c4766..58ad594 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
@@ -50,7 +50,9 @@
public static string WiFiStatus = "CrabtreeAdd/WiFi.png";//"CrabtreeAdd/WiFi.png";
public static string RegisterLogoString = "Logo/Register_logo.png";
public static string SeviceIP = "52.172.25.151";
- public static string RequestHttpsHost = "https://homeautomation.havells.com";
+ //public static string RequestHttpsHost = "https://homeautomation.havells.com";
+ public static string RequestHttpsHost = "https://developer.hdlcontrol.com";
+
public static double PixelScale {
get {
@@ -173,28 +175,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 = $"{RequestHttpsHost}/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