| | |
| | | |
| | | public HttpServerRequest() |
| | | { |
| | | #if DEBUG1 |
| | | severAddress = debugSever; |
| | | #else |
| | | severAddress = relaseaSever; |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | result = Language.StringByID(StringId.FailedToSendVerificationCode); |
| | | break; |
| | | case "EXIST": |
| | | result = Language.StringByID(StringId.AccountAlreadyExists); |
| | | result = Language.StringByID(StringId.AccountAlreadyUse); |
| | | break; |
| | | case "Self:Net_Error": |
| | | result = Language.StringByID(StringId.NetworkAnomaly); |
| | |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/LoginSendVerCode", jsonString, false); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送验证码 |
| | | /// </summary> |
| | | public ResponsePack SendSms(string account) |
| | | { |
| | | string jsonString = "{" +
|
| | | "\"Account\":" + "\"" + account + "\"" + "," + |
| | | "\"Company\":" + MainPage.Company + "," + |
| | | "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + |
| | | "\"AreaCode\":" + OnAppConfig.Instance.CountryNumber + |
| | | "}"; |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/LoginSendVerCode", jsonString, false); |
| | | } |
| | | ///// <summary> |
| | | ///// 发送验证码 |
| | | ///// </summary> |
| | | //public ResponsePack SendSms(string account) |
| | | //{ |
| | | // string jsonString = "{" +
|
| | | // "\"Account\":" + "\"" + account + "\"" + "," + |
| | | // "\"Company\":" + MainPage.Company + "," + |
| | | // "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + |
| | | // "\"AreaCode\":" + OnAppConfig.Instance.CountryNumber + |
| | | // "}"; |
| | | // return RequestHttps($"{severAddress}/ZigbeeUsers/LoginSendVerCode", jsonString, false); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 验证验证码 |
| | |
| | | Name = homeJsonStr.GetValue("Name").ToString(), |
| | | Address = homeJsonStr.GetValue("Address").ToString(), |
| | | IsOthreShare = (bool)homeJsonStr.GetValue("IsOthreShare"), |
| | | homeGateways = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGateways>>(homeJsonStr.GetValue("HomeGateways").ToString()), |
| | | }; |
| | | if (home.IsOthreShare) |
| | | { |
| | | continue; |
| | | } |
| | | MainPage.LoginUser.regionList.Add(home); |
| | | if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.CurReginID)) |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region mqtt远程连接(旧) |
| | | /// <summary> |
| | | /// 请求Mqtt数据 |
| | | /// </summary> |
| | | /// <param name="dataStringJson">请求的参数.</param> |
| | | public ResponsePack RequestMqttInfo( string dataStringJson) |
| | | { |
| | | ResponsePack revertObj = null; |
| | | |
| | | var webClient = new WebClient(); |
| | | #region |
| | | webClient.Headers.Add("CONTENT-TYPE", "application/json"); |
| | | var url = "https://global.hdlcontrol.com/ProposedProductionApi/EmqMqtt/GetConnMqttInfo"; |
| | | |
| | | byte[] bytes = null; |
| | | try |
| | | { |
| | | bytes = webClient.UploadData(url, Encoding.UTF8.GetBytes(dataStringJson)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | revertObj = new ResponsePack() { StateCode = "Net_Error" }; |
| | | } |
| | | |
| | | string responseString = null; |
| | | if (bytes != null) |
| | | { |
| | | responseString = Encoding.UTF8.GetString(bytes); |
| | | } |
| | | |
| | | if (responseString != null) |
| | | { |
| | | try |
| | | { |
| | | revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.ToString()); |
| | | } |
| | | } |
| | | return revertObj; |
| | | #endregion |
| | | } |
| | | #endregion |
| | | |
| | | #region 备份部分 |
| | | /// <summary> |
| | | /// 获取住宅备份列表 |