| | |
| | | //{ |
| | | // return; |
| | | //} |
| | | if (DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) |
| | | if (OnAppConfig.Instance.LastLoginUserId == ""|| DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) |
| | | { |
| | | return; |
| | | } |
| | |
| | | /// </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("挤下线"); |
| | | |
| | |
| | | //弹窗提示被挤下线 |
| | | HDLCommon.Current.CheckLogout(); |
| | | }); |
| | | |
| | | |
| | | //UserInfo.Current.LastTime = DateTime.MinValue; |
| | | //UserInfo.Current.SaveUserInfo(); |
| | | |
| | | //Application.RunOnMainThread(() => { |
| | | // MainPage.GoLoginPage(UserInfo.Current); |
| | | // //弹窗提示被挤下线 |
| | | //}); |
| | | |
| | | //2020-08-11 删除推送数据 |
| | | //HDLRequest.Current.PushserivceSignOut (); |
| | | } |
| | | |
| | | ///// <summary> |
| | |
| | | /// </summary> |
| | | static void SendPushSignOut() |
| | | { |
| | | #if DEBUG |
| | | MainPage.Log("调试模式,不发布挤下线主题。"); |
| | | return; |
| | | #endif |
| | | //测试账号,不挤下线 |
| | | switch (UserInfo.Current.AccountString) |
| | | { |
| | | case "15626203746": |
| | | case "13580507523": |
| | | return; |
| | | } |
| | | |
| | | byte[] message = Encoding.UTF8.GetBytes(PushSignStr); |
| | | MqttRemoteSend(message, 4); |
| | | } |
| | |
| | | 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; |
| | | } |