From c00da77d00a479fa5d022346a6d9075f90a5c087 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期六, 14 九月 2024 10:05:34 +0800
Subject: [PATCH] 退出登录时间调整,新风,音乐

---
 HDL_ON/Common/HDLCommon.cs |   92 +++++++++++++++++++++++++--------------------
 1 files changed, 51 insertions(+), 41 deletions(-)

diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 2103bb9..601e1a7 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -565,53 +565,63 @@
         /// </summary>
         public void Logout()
         {
-            //鍔犺浇Loading鏁堟灉
-            var waitPage = new Loading();
-            MainPage.BaseView.AddChidren(waitPage);
-            waitPage.Start(Language.StringByID(StringId.PleaseWait));
-
-            new Thread(() =>
+            try
             {
-                try
+                Application.RunOnMainThread(() =>
                 {
-                    //2.娉ㄩ攢鎺ㄩ��
-                    new HttpServerRequest().SignOutPush();
-                    //3.璺宠浆鐧诲綍椤甸潰
-                    UserInfo.Current.LastTime = DateTime.MinValue;
-                    UserInfo.Current.SaveUserInfo();
-                    DB_ResidenceData.Instance.EixtAccount();
-                    MainPage.Log("閫�鍑鸿处鍙锋竻绌烘暟鎹�");
-                    //4.娉ㄩ攢HDLSIP璐﹀彿鐧诲綍 2021-08-20
-                    HDLLinphone.Current.LogoutAllAccount();
-                    MainPage.Log("娉ㄩ攢HDLSIP璐﹀彿鐧诲綍");
+                    //鍔犺浇Loading鏁堟灉
+                    var waitPage = new Loading();
+                    MainPage.BaseView.AddChidren(waitPage);
+                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
+
+                    new Thread(() =>
+                    {
+                        try
+                        {
+                            //2.娉ㄩ攢鎺ㄩ��
+                            new HttpServerRequest().SignOutPush();
+                            //3.璺宠浆鐧诲綍椤甸潰
+                            UserInfo.Current.LastTime = DateTime.MinValue;
+                            UserInfo.Current.SaveUserInfo();
+                            DB_ResidenceData.Instance.EixtAccount();
+                            MainPage.Log("閫�鍑鸿处鍙锋竻绌烘暟鎹�");
+                            //4.娉ㄩ攢HDLSIP璐﹀彿鐧诲綍 2021-08-20
+                            HDLLinphone.Current.LogoutAllAccount();
+                            MainPage.Log("娉ㄩ攢HDLSIP璐﹀彿鐧诲綍");
 
 #if __IOS__
-                    //5.鍏ㄨ閫氱櫥鍑�
-                    //Shared.IOS.HDLFVSDK.Video.Logout();
-                    //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅
-                    new Other.SkipControl().SetData(false, "", "", "", "");
-                    var sDM = new SiriKit.SceneDateManager();
-                    Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}");
+                            //5.鍏ㄨ閫氱櫥鍑�
+                            //Shared.IOS.HDLFVSDK.Video.Logout();
+                            //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅
+                            new Other.SkipControl().SetData(false, "", "", "", "");
+                            var sDM = new SiriKit.SceneDateManager();
+                            Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}");
 #endif
-                }
-                catch (Exception ex)
-                {
-                    MainPage.Log($"xxx:{ex.Message}");
-                }
-                finally
-                {
-                    Application.RunOnMainThread(() =>
-                    {
-                        if (waitPage != null)
-                        {
-                            waitPage.Hide();
-                            waitPage.RemoveFromParent();
-                            waitPage = null;
                         }
-                        MainPage.GoLoginPage(UserInfo.Current);
-                    });
-                }
-            }).Start();
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"xxx:{ex.Message}");
+                        }
+                        finally
+                        {
+                            Application.RunOnMainThread(() =>
+                            {
+                                if (waitPage != null)
+                                {
+                                    waitPage.Hide();
+                                    waitPage.RemoveFromParent();
+                                    waitPage = null;
+                                }
+                                MainPage.GoLoginPage(UserInfo.Current);
+                            });
+                        }
+                    }).Start();
+                });
+            }
+            catch (Exception ex)
+            {
+                MainPage.Log("Error", $"閫�鍑虹櫥褰曞紓甯�:{ex.StackTrace}");
+            }
         }
 
         /// <summary>

--
Gitblit v1.8.0