From eaaa2635f9ef5e431e00df922731a54c20cf7016 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 31 七月 2023 19:41:58 +0800
Subject: [PATCH] 三相空开备份
---
HDL_ON/DAL/Server/HttpUtil.cs | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index d0b9cf1..f356d18 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
@@ -44,7 +45,6 @@
#endregion
#region **********缃戠粶璇锋眰灏佽**********
-
/// <summary>
/// Get 璇锋眰鏈嶅姟鍣ㄦ柟娉�
/// </summary>
@@ -154,7 +154,7 @@
if(MainPage.NoLoginMode)
{
- return new ResponsePackNew() { Code = "0" };
+ return new ResponsePackNew() { Code = "0" ,Data = "" };
}
#region HttpWebRequest
try
@@ -172,6 +172,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 +185,7 @@
{
request.AddHeader("Authorization", replaceToken);
}
+
if (bodyParameterJson != null)
{
@@ -235,7 +237,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