黄学彪
2019-11-28 3a26f6025130dcaae4aa82ea19b16ad902450eb8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -285,7 +285,7 @@
                        //如果用户已经退出了登陆,则不处理
                        return;
                    }
                    string msg = IMessageCommon.Current.GetMsgByRequestName(RequestName, revertObj.StateCode, pra);
                    string msg = IMessageCommon.Current.GetMsgByRequestName(RequestName, revertObj, pra);
                    if (msg != null)
                    {
                        var control = new ShowMsgControl(ShowMsgType.Tip, msg);
@@ -520,7 +520,7 @@
            Config.Instance.Home.IsOthreShare = isOthreShare;
            Config.Instance.Home.AccountType = accountType;
            Config.Instance.Home.MainUserDistributedMark = mainMark;
            Config.Instance.Home.Save();
            Config.Instance.Home.Save(false);
            //刷新本地网关文件
            HdlGatewayLogic.Current.ReFreshByLocal();
@@ -601,7 +601,7 @@
        {
            UserCenterResourse.Option.OldAccountId = string.Empty;
            //关闭所有接收
            HdlDeviceAttributeLogic.Current.RemoveAllEvent();
            HdlGatewayReceiveLogic.Current.RemoveAllEvent();
            //清除升级列表
            FirmwareUpdateResourse.dicDeviceUpdateList.Clear();
            FirmwareUpdateResourse.dicGatewayUpdateList.Clear();
@@ -622,7 +622,8 @@
                HdlGatewayLogic.Current.ClearAllRealGateway();
                try
                {
                    ZigBee.Device.ZbGateway.RemoteMqttClient?.DisconnectAsync();
                    //断开远程Mqtt连接
                    ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
                }
                catch { }
@@ -790,6 +791,15 @@
            if (Common.Config.Instance.HomeId != UserCenterResourse.Option.OldHomeStringId
                || Common.Config.Instance.Account != UserCenterResourse.Option.OldAccountId)
            {
                try
                {
                    //断开远程Mqtt连接
                    ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
                }
                catch { }
                //消息记录重新读取及检测
                ControlCommonResourse.ReadMessageAgain = true;
                //加载账号配置信息
                var optionInfo = UserCenterResourse.Option.Load();
                UserCenterResourse.Option = optionInfo;
@@ -811,11 +821,9 @@
                CreatAllUserCenterDirectory();
                //关闭所有接收
                HdlDeviceAttributeLogic.Current.RemoveAllEvent();
                HdlGatewayReceiveLogic.Current.RemoveAllEvent();
                //刷新安防上报信息
                HdlAlarmsLogic.Current.RefreshAlarmInfo();
                //添加保存安防设备报警的事件(不需要再执行任何操作,并且永久存在)
                HdlAlarmsLogic.Current.AddAlarmInfoEvent();
                //保存用户的登陆信息到本地
                SaveUserInformationToLocation();
@@ -844,11 +852,11 @@
                HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
                //0:已经同步过,不需要同步,这个时候需要提示备份
                //if (result == 0)
                //{
                //    //开启自动备份提示
                //    HdlAutoBackupLogic.ShowAutoBackupPromptedForm();
                //}
                if (result == 0)
                {
                    //开启自动备份提示
                    HdlAutoBackupLogic.ShowAutoBackupPromptedForm();
                }
            }
            //APP缓存加载完成
            UserCenterResourse.Option.AppCanSignout = true;
@@ -929,7 +937,7 @@
                    newHouse.IsOthreShare = house.IsOthreShare;
                    newHouse.AccountType = house.AccountType;
                    newHouse.MainUserDistributedMark = house.MainUserDistributedMark;
                    newHouse.Save();
                    newHouse.Save(false);
                }
            }
            if (string.IsNullOrEmpty(userInfo.UserName) == true)