| | |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString()); |
| | | UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; |
| | | UserInfo.Current.AccessToken = revertData.accessToken; |
| | | UserInfo.Current.RefreshToken = revertData.refreshToken; |
| | | UserInfo.Current.LastTime = DateTime.Now; |
| | | UserInfo.Current.SaveUserInfo(); |
| | |
| | | } |
| | | |
| | | #region 注册、登录部分 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 通用 发送验证码方法 |
| | | /// </summary> |
| | |
| | | } |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_ForgetPwd, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 修改密码 |
| | | /// </summary> |
| | | /// <param name="loginPwd"></param> |
| | | /// <param name="loginNewPwd"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdataPassword(string loginPwd,string loginNewPwd) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("loginPwd", loginPwd); |
| | | d.Add("loginNewPwd", loginNewPwd); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Update_Pwd, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | foreach (var home in homeList) |
| | | { |
| | | if (home.isBindGateway) |
| | | if (home.isBindGateway)//是否绑定网关 |
| | | { |
| | | UserInfo.Current.regionList.Add(home); |
| | | //新绑定的住宅,直接切换到新住宅 |
| | |
| | | MainPage.cityInfo.weather = jt.GetValue("Weather").ToString(); |
| | | MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString(); |
| | | MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString(); |
| | | |
| | | MainPage.CityWeatherAction?.Invoke(); |
| | | break; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取第三方平台支持的设备类型列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Get3tyIotSupportSpkList(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置第三方设备绑定的住宅 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Set3tyIotFunctionToHouse(string deviceId,string homeId) |
| | | public ResponsePackNew Set3tyIotFunctionToHouse(List<string> deviceIds,string homeId, string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("deviceIds", deviceIds); |
| | | d.Add("homeId", homeId); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson); |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #region 光伏储能 |
| | | /// <summary> |
| | | /// 获取住宅下逆变器列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetInverterList() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_List, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取住宅下光伏统计的数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetInverterStatisticsInfo() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson); |
| | | return pack; |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |