From f2c1e5bf3a67478076fb5bbcf546824b3127db15 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期六, 12 十二月 2020 19:11:40 +0800
Subject: [PATCH] Merge branch 'NewFilePath' into CJL

---
 HDL_ON/UI/MainPage.cs |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index fdb0e3d..095d6f1 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -91,31 +91,36 @@
                 BaseView = Application.MainPage;
                 Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor;
 
-                //LoginUser = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfo>(System.Text.Encoding.UTF8.GetString(FileUtils.ReadFile("UserInfo_File")));
-                //鍒ゆ柇闇�涓嶉渶瑕佺櫥褰曪紝鏈夋病鏈夌櫥褰曪紝鎴栬�呯櫥褰曟槸鍚﹁繃鏈燂紝
-                if (UserInfo.Current == null || !UserInfo.Current.IsLogin)
+
+                if (string.IsNullOrEmpty(OnAppConfig.Instance.LastLoginUserId))
                 {
-                    GoLoginPage(UserInfo.Current);
+                    GoLoginPage();
                 }
                 else
                 {
-                    new System.Threading.Thread(() =>
+                    //鍒ゆ柇闇�涓嶉渶瑕佺櫥褰曪紝鏈夋病鏈夌櫥褰曪紝鎴栬�呯櫥褰曟槸鍚﹁繃鏈燂紝
+                    if (UserInfo.Current == null || !UserInfo.Current.IsLogin)
                     {
-                        var pm = new DAL.Server.HttpServerRequest();
-                        pm.RefreshToken();//鍒锋柊Token
+                        GoLoginPage(UserInfo.Current);
+                    }
+                    else
+                    {
+                        new System.Threading.Thread(() =>
+                        {
+                            var pm = new DAL.Server.HttpServerRequest();
+                            pm.RefreshToken();//鍒锋柊Token
                         pm.GetHomePager();//鍒锋柊浣忓畢淇℃伅
                         pm.GetUserInfo();//鍒锋柊涓汉淇℃伅
                     })
-                    { IsBackground = true }.Start();
+                        { IsBackground = true }.Start();
 
-                    GoUserPage(true);
-                  
+                        GoUserPage(true);
 
-                    ///鍒濆鍖朼pp鏁版嵁
-                    InitializationData();
+
+                        ///鍒濆鍖朼pp鏁版嵁
+                        InitializationData();
+                    }
                 }
-
-
             }
             catch (Exception ex)
             {
@@ -236,8 +241,7 @@
             {
                 while (true)
                 {
-                    if (Entity.DB_ResidenceData.residenceData == null ||
-                    Entity.DB_ResidenceData.residenceData.HomeGateway == null)
+                    if (Entity.DB_ResidenceData.residenceData == null )//|| Entity.DB_ResidenceData.residenceData.HomeGateway == null)
                     {
                         System.Threading.Thread.Sleep(100);
                     }

--
Gitblit v1.8.0