| | |
| | | }; |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 退出登录操作 |
| | | ///// </summary> |
| | | //void Logout() |
| | | //{ |
| | | // #region 保存本地数据至文件夹 |
| | | // string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // try |
| | | // { |
| | | // 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); |
| | | // } |
| | | // } |
| | | // FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log($"xxx:{ex.Message}"); |
| | | // } |
| | | // finally |
| | | // { |
| | | // FileUtils.DeleteAllFile(); |
| | | // } |
| | | // }).Start(); |
| | | // #endregion |
| | | |
| | | // //2.注销推送 |
| | | // new HttpServerRequest().SignOutPush(); |
| | | // //3.跳转登录页面 |
| | | // UserInfo.Current.LastTime = DateTime.MinValue; |
| | | // UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像 |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // MainPage.GoLoginPage(UserInfo.Current); |
| | | // DB_ResidenceData.residenceData.EixtAccount(); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 退出登录操作 |
| | | /// </summary> |
| | | void Logout() |
| | | public void LogoutNew() |
| | | { |
| | | #region 保存本地数据至文件夹 |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | new System.Threading.Thread(() => |
| | | //加载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) |
| | |
| | | MainPage.Log("move file : " + fileName); |
| | | } |
| | | } |
| | | FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | 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(); |
| | | |
| | | }); |
| | | } |
| | | }).Start(); |
| | | #endregion |
| | | |
| | | //2.注销推送 |
| | | new HttpServerRequest().SignOutPush(); |
| | | //3.跳转登录页面 |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像 |
| | | UserInfo.Current.SaveUserInfo(); |
| | | MainPage.GoLoginPage(UserInfo.Current); |
| | | DB_ResidenceData.residenceData.EixtAccount(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | Action okAction = () => |
| | | { |
| | | Logout(); |
| | | LogoutNew(); |
| | | }; |
| | | new ConfirmDialog().ShowDialog(StringId.Tip, StringId.IfConfirmLogout, okAction); |
| | | }; |