示例#1
0
        private async void Login()
        {
            //如果没有登录
            if (_loginUserService.GetUserLoginStatus() == false)
            {
                if (new LoginManage().Login(_loginUserService.DefaultLoginServer()))
                {
                    Status = ViewModelStatus.Querying;
                    //把登录配置保存到本地
                    _localConfiguration.WriteServerInfo(_localConfiguration.ServerInfoList);
                    await _loginUserService.SetUserLogin();

                    _eventAggregator.GetEvent <LoginEvent>().Publish(_loginUserService.LoginInfo);
                    Status = ViewModelStatus.None;
                }
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("请退出后再登陆!!!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                //if (LoginManage.Login(_loginUserService.LoginInfo))
                //{
                //    _loginUserService.SetUserLogin();
                //    _eventAggregator.GetEvent<LoginEvent>().Publish(_loginUserService.LoginInfo);
                //    //把登录配置保存到本地
                //    _localConfiguration.WriteServerInfo(_localConfiguration.ServerInfoList);
                //}
            }
        }