| | |
| | | /// <summary> |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// <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 |
| | | { |
| | |
| | | { |
| | | urlHead = OnAppConfig.Instance.RequestHttpsHost; |
| | | } |
| | | //urlHead="https://test-gz.hdlcontrol.com"; |
| | | //"https://bahrain-gateway.hdlcontrol.com"; |
| | | urlHead="https://china-gateway.hdlcontrol.com"; |
| | | string requestFullUrl = urlHead + apiPath; |
| | | |
| | | |
| | |
| | | /// 计算sign签名 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static string GetSignRequestJson(object requestObj) |
| | | public static string GetSignRequestJson(object requestObj,Dictionary<string,object> paramDictionary = null) |
| | | { |
| | | try |
| | | { |
| | | //1. 将model实体转为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) |
| | | { |