Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }