From acc8caee31c4be90bd38d1af18136b0e84f6fe94 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期五, 27 九月 2024 14:01:19 +0800 Subject: [PATCH] Merge branch 'feature/v2.7_迭代' into feature/V2.7_Google --- HDL_ON/DAL/Mqtt/MqttClient.cs | 65 ++++++++++---------------------- 1 files changed, 20 insertions(+), 45 deletions(-) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index cea69ec..9593aef 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -59,7 +59,7 @@ /// <summary> /// 鎺ㄩ�佹爣璇� /// </summary> - static string PushSignStr = DateTime.Now.Ticks.ToString(); + static string PushSignStr = OnAppConfig.Instance.PushSignStr; /// <summary> /// 鏂紑杩滅▼Mqtt鐨勯摼鎺� @@ -353,11 +353,11 @@ } MainPage.LinkHdlMqttCount++; - if (!UserInfo.Current.IsLogin) - { - return; - } - if (DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) + //if (!UserInfo.Current.IsLogin) + //{ + // return; + //} + if (OnAppConfig.Instance.LastLoginUserId == ""|| DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) { return; } @@ -860,18 +860,8 @@ /// </summary> static void ReceiveNotifySqueezeAsync(string mMes) { + MainPage.Log($"鎺ㄩ�佹爣璇嗭細{mMes};鏈湴鏍囪瘑锛歿PushSignStr}"); if (mMes == PushSignStr) return;//鏄嚜宸辩殑鐧诲綍鎺ㄩ�佷笉澶勭悊//鎴栬�呭綋鍓嶄笉鏄繙绋嬮摼鎺ョ姸鎬� - //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾� - switch (UserInfo.Current.userMobileInfo) - { - case "15626203746": - return; - } - - if (!UserInfo.Current.IsLogin) - { - return; - } DisConnectRemoteMqttClient("鎸や笅绾�"); @@ -880,40 +870,26 @@ //寮圭獥鎻愮ず琚尋涓嬬嚎 HDLCommon.Current.CheckLogout(); }); - - - //UserInfo.Current.LastTime = DateTime.MinValue; - //UserInfo.Current.SaveUserInfo(); - - //Application.RunOnMainThread(() => { - // MainPage.GoLoginPage(UserInfo.Current); - // //寮圭獥鎻愮ず琚尋涓嬬嚎 - //}); - - //2020-08-11 鍒犻櫎鎺ㄩ�佹暟鎹� - //HDLRequest.Current.PushserivceSignOut (); } - - ///// <summary> - ///// 鏀跺埌CheckGateway涓婚 - ///// </summary> - //static void ReceiveCheckGateway(string mMes) - //{ - // if (!Control.Ins.IsRemote) return; - - // Utlis.WriteLine("ReceiveCheckGateway锛�"); - - // //CheckIfNeedReadAllDeviceStatus (); - - // //var obj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(mMes); - // Control.Ins.GatewayOnline = true; - //} /// <summary> /// 鎺ㄩ�佹尋涓嬬嚎涓婚 /// </summary> static void SendPushSignOut() { +#if DEBUG + MainPage.Log("璋冭瘯妯″紡锛屼笉鍙戝竷鎸や笅绾夸富棰樸��"); + return; +#endif + //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾� + switch (UserInfo.Current.AccountString) + { + case "15626203746": + case "13580507523": + case "18475593023": + return; + } + byte[] message = Encoding.UTF8.GetBytes(PushSignStr); MqttRemoteSend(message, 4); } @@ -941,7 +917,6 @@ break; case 4://鍙戝竷鏂版柟妗堢殑鎸や笅绾夸富棰� topicName = $"/BusGateWayToClient/{UserInfo.Current.ID}" + PushNotifySqueeze; - //message = Encoding.UTF8.GetBytes (PushSignStr); await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); break; } -- Gitblit v1.8.0