From cd70a2a8a2bdebf51259d8f39ed110a34b9be9e5 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 11 四月 2023 14:50:21 +0800 Subject: [PATCH] 修改启动屏幕 --- HDL_ON/DAL/Server/HttpUtil.cs | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index d0b9cf1..211486b 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -6,6 +6,7 @@ using System.Text; using HDL_ON.Entity; using RestSharp; +using Shared; namespace HDL_ON.DAL.Server { @@ -17,8 +18,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //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 = "http://59.41.255.150:7777";//mmmm @@ -172,6 +173,7 @@ RestRequest request = new RestRequest(method); request.Timeout = mTimeout * 1000; request.AddHeader("content-type", "application/json"); + request.AddHeader("language", Language.CurrentLanguage == "Chinese" ? "cn" : "en");//澧炲姞璇█鏍囪瘑 wxr 2023-03-22 17:03:34 if (string.IsNullOrEmpty(replaceToken)) { @@ -184,6 +186,7 @@ { request.AddHeader("Authorization", replaceToken); } + if (bodyParameterJson != null) { @@ -235,7 +238,19 @@ } else { - HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.ErrorMessage); + HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.Content); + if(response.Content!= null) + { + try + { + var pack = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content); + if (pack != null) + { + return pack; + } + } + catch { } + } return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; } -- Gitblit v1.8.0