public void Execute(object parameter) { LoggedViewModel loggedViewModel = new LoggedViewModel(); Config config = new Config(); loggedViewModel.AllLoggedProcesses = new ObservableCollection <MyProcess>(config.DeserializeProcessesFromJson()); LoggedProcessWindow loggedProcessWindow = new LoggedProcessWindow(loggedViewModel); loggedProcessWindow.ShowDialog(); }
public LoggedViewModel Login(LogingViewModel login, string strKey, string issuer, int expires) { LoggedViewModel loggedIn = new LoggedViewModel(); if (login.Email == "*****@*****.**" && login.Password == "123456") { var user = new UserViewModel { Ext_Id = "random", Name = "Usuario", UserName = "******", }; var hasEntity = true; var tokenString = BuildToken(user, strKey, issuer, expires); loggedIn.User = user; loggedIn.User.HasEntity = hasEntity; loggedIn.Token = tokenString; } return(loggedIn);; }
/// <summary> /// 根据logoutId获取登陆信息,OAuth2.0 /// </summary> /// <param name="logoutId"></param> /// <returns></returns> private async Task <LoggedViewModel> GetLoggedViewModelsAsync(string logoutId) { var logoutContext = await _interaction.GetLogoutContextAsync(logoutId); LoggedViewModel loggedViewModel = new LoggedViewModel(); if (logoutContext == null) { return(loggedViewModel); } else { if (string.IsNullOrEmpty(logoutContext.PostLogoutRedirectUri)) { throw new InvalidOperationException($"该登陆id没有登出返回链接,Id:{logoutId},ClientName:{logoutContext.ClientName}"); } loggedViewModel.LogoutReturnUrl = logoutContext.PostLogoutRedirectUri; } return(loggedViewModel); }
public async Task <IActionResult> Logout(string logoutid) { LoggedViewModel vm; ViewData["IsAuthenticated"] = false; ViewData["UserName"] = ""; if (string.IsNullOrEmpty(logoutid)) { vm = new LoggedViewModel(); } else { vm = await GetLoggedViewModelsAsync(logoutid); } if (User?.Identity.IsAuthenticated == true) { await _signInManager.SignOutAsync(); } return(View(vm)); }
public LoggedProcessWindow(LoggedViewModel LoggedViewModel) { InitializeComponent(); this.LoggedViewModel = LoggedViewModel; DataContext = LoggedViewModel; }