wxr
2020-11-20 716d1b3b705e7d37e6edebd7f60b7613ab5aee87
HDL_ON/Common/MqttCommon.cs
@@ -158,7 +158,7 @@
//                    try
//                    {
//                        System.Threading.Thread.Sleep(200);
//                        //if (!MainPage.LoginUser.IsLogin) {
//                        //if (! UserInfo.Current.IsLogin) {
//                        //    continue;
//                        //}
//                        if (!CommonPage.IsRemote) continue;
@@ -207,7 +207,7 @@
//                    var topicFilterPush2 = new TopicFilter
//                    {
//                        Topic = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze,
//                        Topic = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze,
//                        QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce,
//                        //QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce
//                    };
@@ -255,7 +255,7 @@
//                return;
//            }
//            if (!MainPage.LoginUser.IsLogin)
//            if (! UserInfo.Current.IsLogin)
//            {
//                return;
//            }
@@ -315,7 +315,7 @@
//                                //    ReceiveNotifySqueezeAsync (mMes);
//                                //} else
//                                if (topic == $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze)
//                                if (topic == $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze)
//                                {
//                                    var mMes = System.Text.Encoding.UTF8.GetString(e.ApplicationMessage.Payload);
//                                    //新挤下线主题方案 收到挤下线主题
@@ -679,7 +679,7 @@
//                    var username = MqttInfoConfig.Instance.mMqttInfo.connEmqUserName;
//                    var passwordRemote = MqttInfoConfig.Instance.mMqttInfo.connEmqPwd;
//                    MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId;
//                    //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString;
//                    //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken =  UserInfo.Current.LoginTokenString;
//                    //获取参数成功,保存到本地并标记为true
//                    MqttInfoConfig.Instance.IfGetMqttInfoSuccess = true;
@@ -818,19 +818,19 @@
//            //断开远程连接
//            CommonPage.IsRemote = false;
//            if (!MainPage.LoginUser.IsLogin)
//            if (! UserInfo.Current.IsLogin)
//            {
//                return;
//            }
//            DisConnectRemoteMqttClient("挤下线");
//            MainPage.LoginUser.LastTime = DateTime.MinValue;
//            MainPage.LoginUser.SaveUserInfo();
//             UserInfo.Current.LastTime = DateTime.MinValue;
//             UserInfo.Current.SaveUserInfo();
//            Room.Lists.Clear();
//            ////删除推送数据
//            //var webclient = new System.Net.WebClient ();
//            //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, MainPage.LoginUser.LoginTokenString);
//            //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization,  UserInfo.Current.LoginTokenString);
//            //webclient.DownloadStringAsync (new Uri ("https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/SignOut"));
@@ -838,7 +838,7 @@
//            Application.RunOnMainThread(() =>
//            {
//                Utlis.ShowAppLinkStatus(AppLinkStatus.WiFi);
//                new Shared.SimpleControl.Phone.AccountLogin(MainPage.LoginUser.AccountString, "").Show();
//                new Shared.SimpleControl.Phone.AccountLogin( UserInfo.Current.AccountString, "").Show();
//                SharedMethod.SharedMethod.CurPageLayout = null;
//                //CommonPage.IsRemote = false;
@@ -852,7 +852,7 @@
//            //2020-06-30 删除推送数据
//            ForceUpdateUtlis.Current.SignOut();
//#if HDL
//            if (!String.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) {
//            if (!String.IsNullOrEmpty ( UserInfo.Current.AllVisionRegisterDevUserNameGuid)) {
//                com.freeview.global.Video.Logout ();
//            }///BusGateWayToClient/320c1fea-1866-4708-8277-e2321a4dd236/NotifyGateWayInfoChange
//#endif
@@ -945,7 +945,7 @@
//                        await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce });
//                        break;
//                    case 4://发布新方案的挤下线主题
//                        topicName = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze;
//                        topicName = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze;
//                        //message = System.Text.Encoding.UTF8.GetBytes (PushSignStr);
//                        await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce });
//                        break;
@@ -1003,7 +1003,7 @@
//        {
//            var mqttInfoRequestPar = new GetConnMqttInfoObj()
//            {
//                LoginAccessToken = MainPage.LoginUser.LoginTokenString,
//                LoginAccessToken =  UserInfo.Current.LoginTokenString,
//                PlatformStr = GetRandomKey(),
//                PublishPayloadJsonStr = PushSignStr,
//                Mac = UserConfig.Instance.GatewayMAC,
@@ -1029,7 +1029,7 @@
//                            MqttInfoConfig.Instance.CurRemoteMACInfo = mqttInfoRequestResult_Obj.AccountAllGateways.Find((obj) => obj.mac == UserConfig.Instance.GatewayMAC);
//                            if (MqttInfoConfig.Instance.CurRemoteMACInfo != null)
//                            {
//                                //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString;
//                                //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken =  UserInfo.Current.LoginTokenString;
//                                MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId;
//                                //----第三步 开始连接
//                                await MQTTConnectAsync();