| | |
| | | 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(); |
| | | //启动密码验证 |
| | | new AppUnlockPage().LoadPage(); |
| | | GoUserPage(true); |
| | | |
| | | ///初始化app数据 |
| | | InitializationData(); |
| | | |
| | | ///初始化app数据 |
| | | InitializationData(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 进入主页 |
| | | /// </summary> |
| | | public static void GoUserPage() |
| | | /// <param name="isFirstOpen">如果是第一次启动 检测校验密码</param> |
| | | public static void GoUserPage(bool isFirstOpen = false) |
| | | { |
| | | //加载Loading效果 |
| | | var waitPage = new Loading(); |
| | |
| | | }; |
| | | BaseView.AddChidren(BasePageView); |
| | | |
| | | //跳转页面---- |
| | | var userPage = new UserPage(); |
| | | //跳转页面---- |
| | | var userPage = new UserPage(); |
| | | BasePageView.AddChidren(userPage); |
| | | userPage.LoadPage(); |
| | | BasePageView.PageIndex = 0; |
| | | |
| | | if (isFirstOpen) |
| | | { |
| | | //启动密码验证 |
| | | new AppUnlockPage().LoadPage(isFirstOpen); |
| | | } |
| | | }); |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"GoUserPage : {ex.Message}"); |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |