From 9bc0ea236cad9e5c86d0d6fe03eabb327b693096 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期三, 11 九月 2024 18:03:16 +0800 Subject: [PATCH] Update SplashActivity.cs --- HDL_ON/DAL/Server/HttpUtil.cs | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index ae59520..bac48c5 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -19,14 +19,12 @@ /// 鍏叡鍩熷悕灏辫繎瑙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 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 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"; @@ -38,7 +36,7 @@ /// <summary> /// 璇锋眰瓒呮椂鏃堕棿 /// </summary> - public const int TIME_OUT = 15; + public const int TIME_OUT = 10; /// <summary> /// 鐗规畩鎺ュ彛璇锋眰瓒呮椂鏃堕棿 /// </summary> @@ -162,6 +160,11 @@ { return new ResponsePackNew() { Code = "0" ,Data = "" }; } + if (!Common.ApiUtlis.Ins.hadInternet) + { + MainPage.Log("娌℃湁澶栫綉锛岀洿鎺ラ��鍑鸿姹�"); + return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; + } #region HttpWebRequest try { @@ -214,7 +217,7 @@ } } IRestResponse response = client.Execute(request); - HDL_ON.Utlis.WriteLine("鍙戦��", requestFullUrl, response.Request.Body?.Value.ToString()); + MainPage.Log("鍙戦��:"+ requestFullUrl, response.Request.Body?.Value.ToString()); if(apiPath == NewAPI.API_POST_Login) { var ddd = Newtonsoft.Json.JsonConvert.SerializeObject(response); @@ -261,14 +264,14 @@ } catch { } } - return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; + return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; } } catch (Exception ex) { HDL_ON.Utlis.WriteLine(ex.Message); - return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; + return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR ,message = Language.StringByID(StringId.FailedRequestServer) }; } #endregion @@ -503,14 +506,14 @@ else { HDL_ON.Utlis.WriteLine(response.Content); - return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; + return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; } } catch (Exception ex) { HDL_ON.Utlis.WriteLine(ex.Message); - return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; + return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; } #endregion -- Gitblit v1.8.0