| | |
| | | using System.Text; |
| | | using HDL_ON.Entity; |
| | | using RestSharp; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.DAL.Server |
| | | { |
| | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 固定域名 |
| | | /// 固定域名,正式环境 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://center.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | |
| | | /// <summary> |
| | |
| | | try |
| | | { |
| | | |
| | | //if (string.IsNullOrEmpty(urlHead)) |
| | | //{ |
| | | // urlHead = UserInfo.Current.RequestHttpsHost; |
| | | //} |
| | | //string requestFullUrl = urlHead + apiPath; |
| | | if (string.IsNullOrEmpty(urlHead)) |
| | | { |
| | | urlHead = UserInfo.Current.RequestHttpsHost; |
| | | } |
| | | string requestFullUrl = urlHead + apiPath; |
| | | |
| | | |
| | | //**************测试************** |
| | | string requestFullUrl = GlobalRequestHttpsHost + apiPath; |
| | | //**************测试************** |
| | | ////**************测试************** |
| | | //string requestFullUrl = GlobalRequestHttpsHost + apiPath; |
| | | ////**************测试************** |
| | | |
| | | RestClient client = new RestClient(requestFullUrl); |
| | | |
| | |
| | | #region RestRequest |
| | | try |
| | | { |
| | | //if (string.IsNullOrEmpty (urlHead)) { |
| | | // urlHead = UserInfo.Current.RequestHttpsHost; |
| | | //} |
| | | //string requestFullUrl = urlHead + apiPath; |
| | | if (string.IsNullOrEmpty(urlHead)) |
| | | { |
| | | urlHead = UserInfo.Current.RequestHttpsHost; |
| | | } |
| | | string requestFullUrl = urlHead + apiPath; |
| | | |
| | | //**************测试************** |
| | | string requestFullUrl = GlobalRequestHttpsHost + apiPath; |
| | | //**************测试************** |
| | | ////**************测试************** |
| | | //string requestFullUrl = GlobalRequestHttpsHost + apiPath; |
| | | ////**************测试************** |
| | | |
| | | RestClient client = new RestClient(requestFullUrl); |
| | | //client.Timeout = mTimeout * 1000; |
| | |
| | | try |
| | | { |
| | | |
| | | //if (string.IsNullOrEmpty (urlHead)) { |
| | | // urlHead = UserInfo.Current.RequestHttpsHost; |
| | | //} |
| | | //string requestFullUrl = urlHead + apiPath; |
| | | if (string.IsNullOrEmpty(urlHead)) |
| | | { |
| | | urlHead = UserInfo.Current.RequestHttpsHost; |
| | | } |
| | | string requestFullUrl = urlHead + apiPath; |
| | | |
| | | //**************测试************** |
| | | string requestFullUrl = GlobalRequestHttpsHost + apiPath; |
| | | //**************测试************** |
| | | ////**************测试************** |
| | | //string requestFullUrl = GlobalRequestHttpsHost + apiPath; |
| | | ////**************测试************** |
| | | |
| | | RestClient client = new RestClient(requestFullUrl); |
| | | //client.Timeout = mTimeout * 1000; |
| | |
| | | static string GetTimestamp() |
| | | { |
| | | System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区 |
| | | return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 相差秒数 |
| | | return ((long)(DateTime.Now - startTime).TotalMilliseconds).ToString(); // 相差秒数 |
| | | //return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 相差秒数 |
| | | } |
| | | |
| | | /// <summary> |