From 691dbe24f5724f153e07947c7b75bdfea5f0b6d5 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期二, 24 九月 2024 16:15:15 +0800 Subject: [PATCH] 离线控制模式 --- HDL_ON/DAL/Server/HttpUtil.cs | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index cd66d30..5d84f01 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -18,15 +18,13 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - const string APP_KEY = "HDL-HOME-APP"; - const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; + //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string APP_KEY = "HDL-HOME-APP"; + //public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; - - //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; - //const string APP_KEY = "HDL-HOME-APP-TEST"; - //const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; - + public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; + public const string APP_KEY = "HDL-HOME-APP-TEST"; + public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm //const string APP_KEY = "CPEVRLRT"; @@ -253,7 +251,7 @@ } else { - HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.Content); + MainPage.Log("Error", $"鎺ュ彛寮傚父:{requestFullUrl} \r\n" + response.Content); if(response.Content!= null) { try @@ -272,7 +270,7 @@ } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + MainPage.Log("Error", $"鎺ュ彛寮傚父x锛歿ex.StackTrace}"); return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR ,message = Language.StringByID(StringId.FailedRequestServer) }; } @@ -332,7 +330,7 @@ UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; UserInfo.Current.AccessToken = revertData.accessToken; UserInfo.Current.RefreshToken = revertData.refreshToken; - UserInfo.Current.LastTime = DateTime.Now; + UserInfo.Current.ValidToken = true; UserInfo.Current.SaveUserInfo(); #if __IOS__ var sdm = new SiriKit.SceneDateManager(); @@ -341,9 +339,9 @@ #endif return true; } - else if (revertObj.Code == StateCode.PasswrodError) + else //if (revertObj.Code == StateCode.PasswrodError) { - UserInfo.Current.LastTime = DateTime.MinValue; + UserInfo.Current.ValidToken = false; } return false; } -- Gitblit v1.8.0