JLChen
2020-12-12 25afbc347932821c7b8bc4d9a6a7acb73eb3f969
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -80,65 +80,65 @@
        //    DB_ResidenceData.residenceData.EixtAccount();
        //}
        /// <summary>
        /// 退出登录操作
        /// </summary>
        public void LogoutNew()
        {
            //加载Loading效果
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
        ///// <summary>
        ///// 退出登录操作
        ///// </summary>
        //public void LogoutNew()
        //{
        //    //加载Loading效果
        //    var waitPage = new Loading();
        //    bodyView.AddChidren(waitPage);
        //    waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new Thread(() =>
            {
                try
                {
                    #region 保存本地数据至文件夹
                    //string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString());
                    ////清空之前的住宅文件
                    //FileUtils.DeleteRegionFiles(oldRegionRootPath);
                    //var backuplist = FileUtils.ReadFiles();
                    ////移动文件
                    //foreach (var fileName in backuplist)
                    //{
                    //    System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName);
                    //    if (fileInfo.Exists)
                    //    {
                    //        fileInfo.MoveTo(oldRegionRootPath + fileName);
                    //        MainPage.Log("move file : " + fileName);
                    //    }
                    //}
                    #endregion
                }
                catch (Exception ex)
                {
                    MainPage.Log($"xxx:{ex.Message}");
                }
                finally
                {
                    //FileUtils.DeleteAllFile();
                    //2.注销推送
                    new HttpServerRequest().SignOutPush();
                    //3.跳转登录页面
                    UserInfo.Current.LastTime = DateTime.MinValue;
                    UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像
                    UserInfo.Current.SaveUserInfo();
                    Shared.Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
        //    new Thread(() =>
        //    {
        //        try
        //        {
        //            #region 保存本地数据至文件夹
        //            //string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString());
        //            ////清空之前的住宅文件
        //            //FileUtils.DeleteRegionFiles(oldRegionRootPath);
        //            //var backuplist = FileUtils.ReadFiles();
        //            ////移动文件
        //            //foreach (var fileName in backuplist)
        //            //{
        //            //    System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName);
        //            //    if (fileInfo.Exists)
        //            //    {
        //            //        fileInfo.MoveTo(oldRegionRootPath + fileName);
        //            //        MainPage.Log("move file : " + fileName);
        //            //    }
        //            //}
        //            #endregion
        //        }
        //        catch (Exception ex)
        //        {
        //            MainPage.Log($"xxx:{ex.Message}");
        //        }
        //        finally
        //        {
        //            //FileUtils.DeleteAllFile();
        //            //2.注销推送
        //            new HttpServerRequest().SignOutPush();
        //            //3.跳转登录页面
        //            UserInfo.Current.LastTime = DateTime.MinValue;
        //            UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像
        //            UserInfo.Current.SaveUserInfo();
        //            Shared.Application.RunOnMainThread(() =>
        //            {
        //                if (waitPage != null)
        //                {
        //                    waitPage.RemoveFromParent();
        //                    waitPage = null;
        //                }
                        MainPage.GoLoginPage(UserInfo.Current);
                        DB_ResidenceData.residenceData.EixtAccount();
        //                MainPage.GoLoginPage(UserInfo.Current);
        //                DB_ResidenceData.residenceData.EixtAccount();
                    });
                }
            }).Start();
        }
        //            });
        //        }
        //    }).Start();
        //}
        /// <summary>
        /// 退出账号登录事件
@@ -149,7 +149,7 @@
            {
                Action okAction = () =>
                {
                    LogoutNew();
                    HDLCommon.Current.Logout();
                };
                new ConfirmDialog().ShowDialog(StringId.Tip, StringId.IfConfirmLogout, okAction);
            };