| | |
| | | /// 刷新Token |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string RefreshToken() |
| | | public string RefreshToken(bool canRefresh = true) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj() |
| | | { |
| | |
| | | { |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | } |
| | | #if __IOS__ |
| | | else if (revertObj.Code == "10001") |
| | | { |
| | | if (canRefresh) |
| | | { |
| | | UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | RefreshToken(false); |
| | | } |
| | | } |
| | | #endif |
| | | return revertObj.Code; |
| | | } |
| | | |
| | |
| | | { |
| | | if (mHomeGatewayRes.Count > 0) |
| | | { |
| | | DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0]; |
| | | DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus; |
| | | DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];//网关状态 |
| | | HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | return revertObj.Code; |
| | | } |
| | |
| | | var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString()); |
| | | if (mHomeGatewayRes != null) |
| | | { |
| | | DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus; |
| | | HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus; |
| | | } |
| | | } |
| | | return revertObj.Code; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | #region 获取天气部分 |
| | | /// <summary> |
| | | /// 获取指定经纬度的城市信息天气信息 |
| | | /// </summary> |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑设备信息 |
| | | /// 绑定关系、名称、收藏 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdataDevcieName(string deviceId,string name) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("name", name); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑设备信息 |
| | | /// 绑定关系、名称、收藏 |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取群控详情 |
| | | /// </summary> |