From d099a65ce3f5f8ed9ba345f8f3bdcf617fa4af75 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 08 十一月 2023 09:55:40 +0800 Subject: [PATCH] 更改udp --- HDL_ON/DAL/Server/HttpServerRequest.cs | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 25c2273..6a3994e 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; @@ -3649,7 +3660,6 @@ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); return pack; } - /// <summary> /// 鑾峰彇缇ゆ帶璇︽儏 /// </summary> -- Gitblit v1.8.0