| | |
| | | UserInfo.Current.LastTime = DateTime.Now; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.AccessToken = UserInfo.Current.LoginTokenString; |
| | | sdm.RefreshToken = UserInfo.Current.RefreshToken; |
| | | #endif |
| | | } |
| | | else if (revertObj.Code == StateCode.PasswrodError) |
| | | { |
| | |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.IsLgoin = true; |
| | | #endif |
| | | } |
| | | } |
| | | return pack; |
| | |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.IsLgoin = true; |
| | | #endif |
| | | } |
| | | } |
| | | return pack; |
| | |
| | | } |
| | | } |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.RegionUrl = DB_ResidenceData.Instance.CurrentRegion.regionUrl; |
| | | sdm.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region 检测更新 |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew CheckAppVersion() |
| | | { |
| | | var requestObj = new AppVersionCheckObj() |
| | | { |
| | | |
| | | }; |
| | | #if __IOS__ |
| | | var requestObj = new AppVersionCheckObj(); |
| | | #if __IOS__ |
| | | requestObj.releaseSystem = "IOS"; |
| | | #else |
| | | #else |
| | | requestObj.releaseSystem = "Android"; |
| | | #endif |
| | | |
| | | #endif |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson); |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 注销账号 |
| | | /// <summary> |
| | |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("version", MainPage.VersionString); |
| | | d.Add("appCode", "1588071238036582401"); |
| | | d.Add("appCode", "1706565357768663041"); |
| | | #if __IOS__ |
| | | d.Add("releaseSystem", "IOS"); |
| | | #else |
| | |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | public ResponsePackNew AddSecurity(List<SecurityAlarm> securities) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("securitys", securities); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Add, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 编辑安防 |
| | | /// </summary> |
| | | public ResponsePackNew EditSecurity(List<SecurityAlarm> securities) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("securitys", securities); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Edit, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 删除安防 |
| | | /// </summary> |
| | | /// <param name="sidList">安防sid</param> |
| | |
| | | d.Add("userSecurityIds", userSecurityIds); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusRead, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 设置安防防区状态 |
| | | /// </summary> |
| | | public ResponsePackNew SetSecurityStatus(List<SecurityState> securityStates) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("securitys", securityStates); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | MainPage.Log($"api安防控制:{requestJson}"); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防bypass设置 |
| | | /// </summary> |
| | | public ResponsePackNew SetSecurityBypass(List<SecurityBypass> securityBypassStates) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("securitys", securityBypassStates); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassSet, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | | /// </summary> |
| | | public ResponsePackNew AddGroupControl(List<GroupControl> groupControls) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditGroupControl(List<GroupControl> groupControls) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | //d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_UpdateGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 群控控制 |