From 3f6685c77beeb12baf840733fb890860f4c26e7c Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 25 七月 2024 17:25:59 +0800
Subject: [PATCH] 2024年07月25日17:24:45
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 45 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 4e6e381..731c865 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -161,7 +161,7 @@
/// 鍒锋柊Token
/// </summary>
/// <returns></returns>
- public string RefreshToken()
+ public string RefreshToken(bool canRefresh = true)
{
var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj()
{
@@ -187,6 +187,17 @@
{
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;
}
@@ -698,8 +709,8 @@
{
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;
}
@@ -765,7 +776,7 @@
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;
@@ -1527,7 +1538,7 @@
}
#endregion
-#region 鑾峰彇澶╂皵閮ㄥ垎
+ #region 鑾峰彇澶╂皵閮ㄥ垎
/// <summary>
/// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅
/// </summary>
@@ -2288,7 +2299,7 @@
d.Add("actions", actionObjs);
var requestJson = HttpUtil.GetSignRequestJson(d);
- MainPage.Log($"api鍔熻兘鎺у埗锛歿requestJson}");
+ MainPage.Log($"api鍙戦�佹帶鍒讹細{requestJson}");
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson);
}
/// <summary>
@@ -2308,6 +2319,23 @@
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>
/// 缂栬緫璁惧淇℃伅
/// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
@@ -3404,7 +3432,7 @@
/// <param name="deviceId"></param>
/// <param name="sound"></param>
/// <returns></returns>
- public ResponsePackNew SetDoorLockSystemSound(string deviceId,string sound)
+ public ResponsePackNew SetDoorLockSystemSound(string deviceId,int sound)
{
var d = new Dictionary<string, object>();
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -3434,7 +3462,7 @@
/// <param name="deviceId"></param>
/// <param name="volume"></param>
/// <returns></returns>
- public ResponsePackNew SetDoorBellTone(string deviceId, string volume)
+ public ResponsePackNew SetDoorBellTone(string deviceId, int volume)
{
var d = new Dictionary<string, object>();
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -3649,7 +3677,6 @@
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
return pack;
}
-
/// <summary>
/// 鑾峰彇缇ゆ帶璇︽儏
/// </summary>
--
Gitblit v1.8.0