public static bool Logout(string username) { if (RoleAction.Session.TryGetValue(username, out string id)) { var _session = ShellSession.GetSession(id); _session.Clear(); RoleAction.Session.Remove(username.ToLower()); return(true); } return(false); }
public static bool IsRepeatLogin(string BaseName) { if (RoleAction.Session.TryGetValue(BaseName, out string id)) { var _session = ShellSession.GetSession(id); //new RedisSession() { SpareId = id }; var keys = _session.GetKeys(); //.Contains("Admin"); if (keys.Contains("Admin")) { if (!IsQiangden) { return(false); } _session.Clear(); } RoleAction.Session.Remove(BaseName.ToLower()); return(true); } return(true); }