| | |
| | | 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 HdlResidenceLogic.Current.GetHomeListsFromDb();
|
| | | var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
|
| | |
|
| | | //刷新个人中心的内存及线程
|
| | | await UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init();
|
| | |
|
| | |
| | | /// </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 |