JLChen
2020-12-20 f77a3add1e7ab266e473da9128bbe5758ba3a890
HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -36,11 +36,11 @@
            try
            {
                var mGlobalRegionListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GlobalRegionListRes>(result.Data.ToString());
                if (UserInfo.Current.RequestHttpsHost != mGlobalRegionListObj.regionUrl)
                if (OnAppConfig.Instance.RequestHttpsHost != mGlobalRegionListObj.regionUrl)
                {
                    UserInfo.Current.RequestHttpsHost = mGlobalRegionListObj.regionUrl;
                    UserInfo.Current.GlobalRegion = mGlobalRegionListObj;
                    UserInfo.Current.SaveUserInfo();
                    OnAppConfig.Instance.RequestHttpsHost = mGlobalRegionListObj.regionUrl;
                    OnAppConfig.Instance.GlobalRegion = mGlobalRegionListObj;
                    OnAppConfig.Instance.SaveConfig();
                }
            }
            catch { }
@@ -635,6 +635,12 @@
                        }
                        else
                        {
                            BindingResidencePage page = new BindingResidencePage();
                            MainPage.BaseView.AddChidren(page);
                            page.LoadView();
                            //2020-11-13 待确认
                            //获取住宅失败,重新标记为未登录状态
                            UserInfo.Current.LastTime = DateTime.MinValue;
@@ -695,6 +701,12 @@
                //    refreshToken = revertData.refreshToken,
                //    userName = revertData.name
                //};
                if (OnAppConfig.Instance.LastLoginUserId != revertData.userId)
                {
                    OnAppConfig.Instance.LastLoginUserId = revertData.userId;
                    OnAppConfig.Instance.SaveConfig();
                }
                UserInfo.Current.ClearUserInfo();
                UserInfo.Current.userType = revertData.userType;
                UserInfo.Current.AccountString = account;
                //UserInfo.Current.password = password;
@@ -703,18 +715,17 @@
                UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken;
                UserInfo.Current.RefreshToken = revertData.refreshToken;
                UserInfo.Current.userName = revertData.name;
                UserInfo.Current.userMobileInfo = "";//重置用户手机
                UserInfo.Current.userEmailInfo = "";//重置用户邮箱
                UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//
                UserInfo.Current.CurReginID = "";
                //UserInfo.Current.userMobileInfo = "";//重置用户手机
                //UserInfo.Current.userEmailInfo = "";//重置用户邮箱
                //UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//
                //UserInfo.Current.CurrentRegion.RegionID = "";
                UserInfo.Current.SaveUserInfo();
                MainPage.Log("登录成功。");
                result = true;
                //获取用户信息
                new Thread(() =>
                {
                    pm.GetUserHeadImage(revertData.userId);
                    pm.GetUserInfo(false);
                    pm.GetUserInfo();
                })
                { IsBackground = true }.Start();
            }
@@ -724,6 +735,8 @@
                //账号或者密码错误
                Application.RunOnMainThread(() =>
                {
                    waitPage.Hide();
                    if (loginResult.Code == "10008")
                    {
                        //用户名或密码错误
@@ -741,10 +754,16 @@
                        btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                        btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
                    }
                    waitPage.Hide();
                    else if (loginResult.Code == "10019")
                    {
                        var tipStr = Language.StringByID(StringId.AccountLoginLock) + "\r\n" + Language.StringByID(StringId.PleaseTryToForgetPassword);
                        Utlis.ShowTip(tipStr);
                        return;
                    }
                    IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code);
                });
                IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code);
            }
            return result;
        }