From 52748710122f275a060538564c1086e69d11ff76 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 08 七月 2021 19:37:18 +0800
Subject: [PATCH] 新增功能:海林传感器,调试云端接口,暂时无法通过接口读取数据 Bug修复:乐橙可视对讲历史记录
---
HDL_ON/DAL/Server/HttpUtil.cs | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 2b7a612..b271fdb 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -16,6 +16,7 @@
/// <summary>
/// 鍥哄畾鍩熷悕,姝e紡鐜
/// 鍏叡鍩熷悕灏辫繎瑙f瀽
+ ///
/// </summary>
public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
//public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
@@ -145,6 +146,12 @@
/// <returns></returns>
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" };
+ }
#region HttpWebRequest
try
{
@@ -153,15 +160,8 @@
{
urlHead = OnAppConfig.Instance.RequestHttpsHost;
}
- //"https://test-gz.hdlcontrol.com";
- //"https://bahrain-gateway.hdlcontrol.com";
- //urlHead="https://china-gateway.hdlcontrol.com";
string requestFullUrl = urlHead + apiPath;
-
- ////**************娴嬭瘯**************
- //string requestFullUrl = GlobalRequestHttpsHost + apiPath;
- ////**************娴嬭瘯**************
RestClient client = new RestClient(requestFullUrl);
@@ -280,7 +280,7 @@
/// <summary>
- /// 鍒锋柊Token
+ /// 鍒锋柊 Token
/// </summary>
/// <returns></returns>
static bool RefreshToken()
@@ -329,10 +329,6 @@
urlHead = OnAppConfig.Instance.RequestHttpsHost;
}
string requestFullUrl = urlHead + apiPath;
-
- ////**************娴嬭瘯**************
- //string requestFullUrl = GlobalRequestHttpsHost + apiPath;
- ////**************娴嬭瘯**************
RestClient client = new RestClient(requestFullUrl);
RestRequest request = new RestRequest(Method.POST);
@@ -572,12 +568,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)
{
--
Gitblit v1.8.0