wei
2020-12-12 73cd2b147d98acb3a945b7b5daad39103fd4377d
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);
                    ///初始化app数据
                    InitializationData();
                        ///初始化app数据
                        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);
                    }