黄学彪
2019-11-25 5727cf0b9b54da0a191dd1e23cb5abf21320fbff
ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -4,7 +4,7 @@
namespace Shared.Phone.UserView
{
    /// <summary>
    /// Home page.
    /// Home page.第二版呀
    /// </summary>
    public class HomePage : PageLayout
    {
@@ -62,15 +62,15 @@
                    {
                        new System.Threading.Thread(async () =>
                        {
                            //启动ZigBee
                            ZigBee.Common.Application.Init();
                            //登录成功
                            var homes = await House.GetHomeLists();
                            //刷新个人中心的内存及线程
                            await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
                            Room.canInitAllRoom = true;
                            Room.CanInitAllRoom = true;
                            Room.InitAllRoom();
                            Application.RunOnMainThread(() =>
@@ -94,6 +94,7 @@
                        //登录失败,也直接进入主页
                        new System.Threading.Thread(async () =>
                        {
                            //启动ZigBee
                            ZigBee.Common.Application.Init();
                            //登录成功
@@ -102,7 +103,7 @@
                            //刷新个人中心的内存及线程
                            await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
                            Room.canInitAllRoom = true;
                            Room.CanInitAllRoom = true;
                            Room.InitAllRoom();
                            Application.RunOnMainThread(() =>
@@ -146,9 +147,6 @@
                    Source = source,
                    Company = company
                };
                //将管理员标识复原
                Config.Instance.isAdministrator = false;
                var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
                var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson));
                if (revertObj == null)
@@ -165,15 +163,13 @@
                        return -1;
                    }
                    //初始化管理员权限信息(里面有特殊判断了,可以直接调用)
                    await UserCenter.UserCenterLogic.InitAdministratorInfo();
                    await UserCenter.UserCenterLogic.InitAdminConnectMqttInfo();
                    var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
                    var revertData = responseDataObj;
                    Config.Instance.UserID = revertData.UserID;
                    Config.Instance.MasterID = revertData.MainUserID;
                    Config.Instance.AccountType = revertData.UserType;
                    Config.Instance.Account = revertData.Account;
                    Config.Instance.Password = password;
                    Config.Instance.MD5PWD = revertData.MD5PWD;
                    Config.Instance.Guid = revertData.Guid;
                    Config.Instance.MqttKey = revertData.MqttKey;
                    Config.Instance.LoginDateTime = DateTime.Now;