Exemplo n.º 1
0
 public ActionResult <LoginMessage> Logout(string empID, string userPass, string adminstate)
 {
     if (login == null)
     {
         login = new MLogin();
     }
     PMUser.EmpID        = empID;
     PMUser.UserPass     = userPass;
     PMUser.UserIpAdress = HttpContext.Connection.LocalIpAddress.ToString();
     PMUser.UserWeb      = Request.Headers["User-Agent"];
     if (login.ForceLogout(empID) == 1)
     {
         return(Login(empID, userPass, adminstate));
     }
     else
     {
         LoginMessage errMessage = new LoginMessage();
         errMessage.LoginState = "0";
         errMessage.Message    = "强制退出失败,请联系管理员。";
         errMessage.EmpID      = login.GetempName(empID);
         return(errMessage);
     }
 }