From 4f2dbd1f6a1ec2d9c3c39b4a37b0b7c9ddece4aa Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 23 九月 2021 15:24:01 +0800 Subject: [PATCH] 主页刷新优化 --- HDL_ON/DAL/Server/HttpUtil.cs | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 4347c31..67c665d 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -16,7 +16,6 @@ /// <summary> /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 - /// /// </summary> public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm @@ -147,6 +146,7 @@ static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) { //Dome妯″紡鐧诲綍 + if(MainPage.NoLoginMode) { return new ResponsePackNew() { Code = "0" }; @@ -161,10 +161,6 @@ } string requestFullUrl = urlHead + apiPath; - - ////**************娴嬭瘯************** - //string requestFullUrl = GlobalRequestHttpsHost + apiPath; - ////**************娴嬭瘯************** RestClient client = new RestClient(requestFullUrl); @@ -283,7 +279,7 @@ /// <summary> - /// 鍒锋柊Token + /// 鍒锋柊 Token /// </summary> /// <returns></returns> static bool RefreshToken() @@ -332,10 +328,6 @@ urlHead = OnAppConfig.Instance.RequestHttpsHost; } string requestFullUrl = urlHead + apiPath; - - ////**************娴嬭瘯************** - //string requestFullUrl = GlobalRequestHttpsHost + apiPath; - ////**************娴嬭瘯************** RestClient client = new RestClient(requestFullUrl); RestRequest request = new RestRequest(Method.POST); @@ -575,12 +567,15 @@ /// 璁$畻sign绛惧悕 /// </summary> /// <returns></returns> - public static string GetSignRequestJson(object requestObj) + public static string GetSignRequestJson(object requestObj,Dictionary<string,object> paramDictionary = null) { try { //1. 灏唌odel瀹炰綋杞负Dictionary<string, object> - var paramDictionary = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(Newtonsoft.Json.JsonConvert.SerializeObject(requestObj)); + if (paramDictionary == null) + { + paramDictionary = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(Newtonsoft.Json.JsonConvert.SerializeObject(requestObj)); + } //2. 璁$畻sign if (paramDictionary != null) { @@ -655,7 +650,7 @@ /// <summary> /// 鍝嶅簲閿欒淇℃伅 /// </summary> - public string message; + public string message = ""; /// <summary> /// 杩欎釜鏄姹傞敊璇椂鐨勬墿灞曟暟鎹�,浠ュ悗鎵�鏈夌殑闄勫甫鎵╁睍鏁版嵁閮戒細鏀惧湪杩欓噷闈㈠姩鎬佺淮鎶� -- Gitblit v1.8.0