using Shared; namespace HDL_ON.DAL.Server { public partial class HttpServerRequest { /* * json格式 "{" + "\"sss\":" + "\"" + sss + "\"" + "," + "\"xxx\":" + xxx + "," + "}"; 获取返回的数据 var sss = Newtonsoft.Json.Linq.JObject.FromObject("sss"); var xxx = homeJsonStr.GetValue("xxx").ToString(), */ #region 注册、登录部分 /// /// 账号登录-使用密码 /// public ResponsePack LoginByPassword(string account, string password) { string jsonString = "{" + "\"Account\":" + "\"" + account + "\"" + "," + "\"Password\":" + "\"" + password + "\"" + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/Login", jsonString, false); } /// /// 手机号码注册 /// /// /// /// public ResponsePack RegisterPhone(string mobileNumber, string password, string language) { string jsonString = "{" + "\"Account\":" + "\"" + mobileNumber + "\"" + "," + "\"Password\":" + "\"" + password + "\"" + "," + "\"Language\":" + "\"" + language + "\"" + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/SignIn", jsonString, false); } public ResponsePack GetAreaCode() { string requestJson = "{}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/GetAreaCode", requestJson, false); } /// /// 验证短信或者邮箱验证码,之后注册 /// /// 账号 /// 密码 /// 确认密码 /// 验证码 /// /// public ResponsePack ValidataCodeAndRegister(string account, string password, string entryPassword, string code, int areaCode) { //var requestObj = new ValidateSmsCodeObj() { Phone = accout, Code = code }; //var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); string requestJson = "{" + "\"Account\":" + "\"" + account + "\"" + "," + "\"Password\":" + "\"" + password + "\"" + "," + "\"EnterPassword\":" + "\"" + entryPassword + "\"" + "," + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + "\"Code\":" + "\"" + code + "\"" + "," + "\"RegisterSoruce\":" + 0 + "," + "\"AreaCode\":" + areaCode + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/ValidataCodeAndRegisterAccount", requestJson, false); } /// /// 获取注册验证码 /// public ResponsePack GetPhoneRegisterVerCode(string account) { string jsonString = "{" + "\"Account\":" + "\"" + account + "\"" + "," + "\"Company\":" + MainPage.Company + "," + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + "\"AreaCode\":" + UserConfig.Instance.CountryNumber + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/RegisterSendVerCode", jsonString, false); } /// /// 获取登录验证码 /// /// 手机号码 public ResponsePack GetPhoneLoginVerCode(string phoneNum) { string jsonString = "{" + "\"Phone\":" + "\"" + phoneNum + "\"" + "," + "\"Company\":" + MainPage.Company + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/LoginSendVerCode", jsonString, false); } /// /// 发送验证码 /// public ResponsePack SendSms(string account) { string jsonString = "{" + "\"Account\":" + "\"" + account + "\"" + "," + "\"Company\":" + MainPage.Company + "," + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + "\"AreaCode\":" + UserConfig.Instance.CountryNumber + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/LoginSendVerCode", jsonString, false); } /// /// 验证验证码 /// /// /// /// public ResponsePack ValidatorCode(string account, string code, int countryIndex) { string jsonString = "{" + "\"Account\":" + "\"" + account + "\"" + "," + "\"Code\":" + "\"" + code + "\"" + "," + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + "\"AreaCode\":" + countryIndex + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/ValidatorCode", jsonString, false); } /// /// 重设密码 /// /// public ResponsePack ResetPassword(string account, string password, string rePassword, int countryIndex) { string jsonString = "{" + "\"Account\":" + "\"" + account + "\"" + "," + "\"Password\":" + "\"" + password + "\"" + "," + "\"AgainPassword\":" + "\"" + rePassword + "\"" + "," + "\"AreaCode\":" + countryIndex + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/ResetPassword", jsonString, false); } #endregion #region 住宅部分 /// /// 获取住宅列表 /// public ResponsePack GetHomePager() { string jsonString = "{" + "\"RequestVersion\":" + "\"" + MainPage.VersionString + "\"" + "," + "\"RequestSource\":" + "\"" + "1" + "\"" + "," + "\"HomeType\":" + "\"" + "1" + "\"" + "," + "\"LoginAccessToken\":" + "\"" + MainPage.LoginUser.LoginTokenString + "\"" + "}"; return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager", jsonString,false); } #endregion } }