| | |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "QWERREWQ"; |
| | | const string SECRET_KEY = "CPBUCTRLCPBUABCD"; |
| | | |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | try |
| | | { |
| | | |
| | | |
| | | if (string.IsNullOrEmpty(urlHead)) |
| | | { |
| | | urlHead = HttpServerRequest.Ins.DataManager.GlobalRequestHttpsHost; |
| | | if (string.IsNullOrEmpty(urlHead)) |
| | | { |
| | | urlHead = "https://nearest.hdlcontrol.com"; |
| | | } |
| | | } |
| | | string requestFullUrl = urlHead + apiPath; |
| | | |
| | | |
| | |
| | | RestRequest request = new RestRequest(method); |
| | | request.Timeout = mTimeout * 1000; |
| | | request.AddHeader("content-type", "application/json"); |
| | | request.AddHeader("language", "cn"); |
| | | |
| | | request.AddHeader("Authorization", HttpServerRequest.Ins.DataManager.AccessToken); |
| | | |
| | | |
| | | if (bodyParameterJson != null) |
| | | { |
| | | request.AddParameter("application/json", bodyParameterJson, ParameterType.RequestBody); |
| | |
| | | } |
| | | else |
| | | { |
| | | var ddd =Newtonsoft.Json.JsonConvert.SerializeObject(response); |
| | | |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | |
| | | { |
| | | var responsePackNew = RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); |
| | | //*****************Token过期处理***************** |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED ) |
| | | { |
| | | //刷新Token |
| | | if (RefreshToken()) { |
| | |
| | | #endregion |
| | | |
| | | #region **********签名校验********** |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string APP_KEY = "QWERREWQ";//"COSDFPIN"; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string SECRET_KEY = "CPBUCTRLCPBUABCD";//"COSDFPJDCOSDFPJT"; |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳值 |