陈嘉乐
2020-09-02 652243206427f35a256400a149a1734085824cb9
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
@@ -98,24 +98,24 @@
            HdlThreadLogic.Current.RunMain(() =>
            {
                //打开启动页
                HomePage.Instance.ShowLoginLoadView();
                CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining));
                
                HdlThreadLogic.Current.RunThread(async () =>
                HdlThreadLogic.Current.RunThread(() =>
                {
                    //账号密码登陆
                    var loginSuccess = await HomePage.Instance.LoginByPWDAsync(account, password);
                    var loginSuccess = HomePage.Instance.LoginByPWDAsync(account, password);
                    if (loginSuccess == 1)
                    {
                        if (string.IsNullOrEmpty(OpenID) == false)
                        {
                            //绑定第三方
                            await BindAuthUser(Config.Instance.Guid, OpenID);
                            BindAuthUser(Config.Instance.Guid, OpenID);
                        }
                        var homes = await House.GetHomeLists();
                        var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                        //刷新个人中心的内存及线程
                        await UserCenterLogic.InitUserCenterMenmoryAndThread();
                        bool result = UserCenterLogic.InitUserCenterMenmoryAndThread();
                        //启动ZigBee
                        ZigBee.Common.Application.Init();
@@ -125,7 +125,11 @@
                            this.RemoveFromParent();
                            CommonPage.Instance.RemoveViewByTag("Register");
                            CommonPage.Instance.RemoveViewByTag("Login");
                            UserPage.Instance.Fresh();
                            if (result == true)
                            {
                                //false:开启了调试功能
                                UserPage.Instance.ReFreshControl();
                            }
                        });
                    }
                    else
@@ -135,7 +139,7 @@
                            //未登录成功弹出登录界面 同时需要标记为未登录状态
                            Config.Instance.LoginDateTime = new DateTime(1970, 1, 1);
                            Config.Instance.Save();
                            var login = new AccountLogin();
                            var login = new AccountLoginForm();
                            CommonPage.Instance.AddChidren(login);
                            login.ShowForm(account);
                        });
@@ -153,14 +157,14 @@
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="openId"></param>
        private async System.Threading.Tasks.Task BindAuthUser(string guid, string openId)
        private void BindAuthUser(string guid, string openId)
        {
            var auth = new SendDataToServer.BindAuthUser();
            auth.AccountGuid = guid;
            auth.OpenID = openId;
            var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth);
            await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/BindAuthUserToAccount", Encoding.UTF8.GetBytes(requestJson));
            CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/BindAuthUserToAccount", Encoding.UTF8.GetBytes(requestJson));
        }
        #endregion