| | |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | public const string APP_KEY = "HDL-HOME-APP"; |
| | | public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; |
| | | |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//开发环境 |
| | | //const string APP_KEY = "CPEVRLRT";//开发环境APP_KEY |
| | | //const string SECRET_KEY = "CPEVRLSJCPEVRLSZ";//开发环境SECRET_KEY |
| | | |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | | //const string APP_KEY = "CPEVRLRT"; |
| | | //const string SECRET_KEY = "CPEVRLSJCPEVRLSZ"; |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 请求超时时间 |
| | | /// </summary> |
| | | public const int TIME_OUT = 15; |
| | | public const int TIME_OUT = 10; |
| | | /// <summary> |
| | | /// 特殊接口请求超时时间 |
| | | /// </summary> |
| | |
| | | { |
| | | return new ResponsePackNew() { Code = "0" ,Data = "" }; |
| | | } |
| | | if (!Common.ApiUtlis.Ins.hadInternet) |
| | | { |
| | | MainPage.Log("没有外网,直接退出请求"); |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; |
| | | } |
| | | #region HttpWebRequest |
| | | try |
| | | { |
| | |
| | | } |
| | | } |
| | | IRestResponse response = client.Execute(request); |
| | | HDL_ON.Utlis.WriteLine("发送", requestFullUrl, response.Request.Body?.Value.ToString()); |
| | | MainPage.Log("发送:"+ requestFullUrl, response.Request.Body?.Value.ToString()); |
| | | if(apiPath == NewAPI.API_POST_Login) |
| | | { |
| | | var ddd = Newtonsoft.Json.JsonConvert.SerializeObject(response); |
| | |
| | | } |
| | | catch { } |
| | | } |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR ,message = Language.StringByID(StringId.FailedRequestServer) }; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | else |
| | | { |
| | | HDL_ON.Utlis.WriteLine(response.Content); |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) }; |
| | | } |
| | | |
| | | #endregion |