| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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"; |
| | | |
| | | /// <summary> |
| | | /// Get 请求服务器方法 |
| | |
| | | } |
| | | return signstr.ToLower(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断当前值是否需要参与签名,保持跟云端一致 |
| | | /// 空字符串不参与 |
| | | /// 数组,集合,对象不参与 |
| | | /// </summary> |
| | | /// <param name="valueStr"></param> |
| | | /// <returns></returns> |
| | | static bool IfValueNeedSign(string valueStr) |
| | | { |
| | | if (string.IsNullOrEmpty(valueStr) || valueStr.StartsWith("{") || valueStr.StartsWith("[")) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | /// <summary> |
| | | /// 2020-11-02 |
| | | /// 基础服务的接口都要校验sign |
| | |
| | | if (item.Value != null) |
| | | { |
| | | //Value.ToString()为null或者""也不参加校验 |
| | | if (!string.IsNullOrEmpty(item.Value.ToString()) && (item.Value is string || item.Value.GetType().IsValueType)) |
| | | //if (!string.IsNullOrEmpty(item.Value.ToString()) && (item.Value is string || item.Value.GetType().IsValueType)) |
| | | //{ |
| | | //检测当前参数是否需要参与校验 |
| | | if (IfValueNeedSign(item.Value.ToString())) |
| | | { |
| | | //如果是bool类型,要转小写 |
| | | if (item.Value is bool) |