From e87985ec1dcb69beedaf9f95e8e7aba14b7c08d6 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 09 十二月 2020 18:50:14 +0800
Subject: [PATCH] 2020-12-09 1.信息中心,增加下划线和点击Alter提醒详情。

---
 HDL_ON/DAL/Server/HttpUtil.cs |   98 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 66 insertions(+), 32 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index cd78756..1cca265 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -6,7 +6,6 @@
 using System.Text;
 using HDL_ON.Entity;
 using RestSharp;
-using Shared;
 
 namespace HDL_ON.DAL.Server
 {
@@ -38,9 +37,9 @@
         #endregion
 
         /// <summary>
-        /// 鍥哄畾鍩熷悕
+        /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://center.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
         public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
 
         /// <summary>
@@ -96,12 +95,12 @@
         public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = 10)
         {
             string urlHead = DB_ResidenceData.residenceData.residecenInfo.regionUrl;
-            var replaceToken = "";
-            if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare)
-            {
-                replaceToken = DB_ResidenceData.residenceData.MasterToken;
-            }
-            return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, replaceToken, mTimeout);
+            //var replaceToken = "";
+            //if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare)
+            //{
+            //    replaceToken = DB_ResidenceData.residenceData.MasterToken;
+            //}
+            return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, "", mTimeout);
         }
 
         /// <summary>
@@ -152,16 +151,16 @@
             try
             {
 
-                //if (string.IsNullOrEmpty(urlHead))
-                //{
-                //    urlHead = UserInfo.Current.RequestHttpsHost;
-                //}
-                //string requestFullUrl = urlHead + apiPath;
+                if (string.IsNullOrEmpty(urlHead))
+                {
+                    urlHead = UserInfo.Current.RequestHttpsHost;
+                }
+                string requestFullUrl = urlHead + apiPath;
 
 
-                //**************娴嬭瘯**************
-                string requestFullUrl = GlobalRequestHttpsHost + apiPath;
-                //**************娴嬭瘯**************
+                ////**************娴嬭瘯**************
+                //string requestFullUrl = GlobalRequestHttpsHost + apiPath;
+                ////**************娴嬭瘯**************
 
                 RestClient client = new RestClient(requestFullUrl);
 
@@ -265,14 +264,15 @@
             #region RestRequest
             try
             {
-                //if (string.IsNullOrEmpty (urlHead)) {
-                //    urlHead = UserInfo.Current.RequestHttpsHost;
-                //}
-                //string requestFullUrl = urlHead + apiPath;
+                if (string.IsNullOrEmpty(urlHead))
+                {
+                    urlHead = UserInfo.Current.RequestHttpsHost;
+                }
+                string requestFullUrl = urlHead + apiPath;
 
-                //**************娴嬭瘯**************
-                string requestFullUrl = GlobalRequestHttpsHost + apiPath;
-                //**************娴嬭瘯**************
+                ////**************娴嬭瘯**************
+                //string requestFullUrl = GlobalRequestHttpsHost + apiPath;
+                ////**************娴嬭瘯**************
 
                 RestClient client = new RestClient(requestFullUrl);
                 //client.Timeout = mTimeout * 1000;
@@ -335,14 +335,15 @@
             try
             {
 
-                //if (string.IsNullOrEmpty (urlHead)) {
-                //    urlHead = UserInfo.Current.RequestHttpsHost;
-                //}
-                //string requestFullUrl = urlHead + apiPath;
+                if (string.IsNullOrEmpty(urlHead))
+                {
+                    urlHead = UserInfo.Current.RequestHttpsHost;
+                }
+                string requestFullUrl = urlHead + apiPath;
 
-                //**************娴嬭瘯**************
-                string requestFullUrl = GlobalRequestHttpsHost + apiPath;
-                //**************娴嬭瘯**************
+                ////**************娴嬭瘯**************
+                //string requestFullUrl = GlobalRequestHttpsHost + apiPath;
+                ////**************娴嬭瘯**************
 
                 RestClient client = new RestClient(requestFullUrl);
                 //client.Timeout = mTimeout * 1000;
@@ -423,6 +424,38 @@
         }
 
         /// <summary>
+        /// 涓嬭浇鏂囦欢  璇锋眰鏈嶅姟鍣ㄦ柟娉�
+        /// </summary>
+        /// <param name="apiPath"></param>
+        /// <param name="bodyParameterJson"></param>
+        /// <param name="queryDictionary"></param>
+        /// <param name="urlHead"></param>
+        /// <param name="replaceToken"></param>
+        /// <param name="mTimeout"></param>
+        /// <returns></returns>
+        public static byte[] HttpsDownload(string requestFullUrl, int mTimeout = 30)
+        {
+            #region RestRequest
+            try
+            {
+                RestClient client = new RestClient(requestFullUrl);
+                RestRequest request = new RestRequest(Method.GET);
+                request.Timeout = mTimeout * 1000;
+
+                IRestResponse response = client.Execute(request);
+                return response.RawBytes;
+            }
+            catch (Exception ex)
+            {
+                HDL_ON.Utlis.WriteLine(ex.Message);
+                return null;
+            }
+            #endregion
+
+        }
+
+
+        /// <summary>
         /// 
         /// </summary>
         const string APP_KEY = "HDL-HOME-APP-TEST";
@@ -438,7 +471,8 @@
         static string GetTimestamp()
         {
             System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯
-            return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟
+            return ((long)(DateTime.Now - startTime).TotalMilliseconds).ToString(); // 鐩稿樊绉掓暟
+            //return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟
         }
 
         /// <summary>

--
Gitblit v1.8.0