Ejemplo n.º 1
0
 public ActionResult Login(AdminLogin adminLogin)
 {
     if (ModelState.IsValid)
     {
         if (adminLogin.Code == TempData["code"].ToString())
         {
             bool i = Logins.Login(adminLogin.PhoneNum, adminLogin.Pwd);
             if (i)
             {
                 Session["LoginId"] = adminUserService.GetPhoneUpdate(adminLogin.PhoneNum);
                 return(Json(new AjaxReault {
                     Statin = "ok"
                 }));
             }
             else
             {
                 return(Json(new AjaxReault {
                     Msg = "用户名或密码不正确"
                 }));
             }
         }
         else
         {
             return(Json(new AjaxReault {
                 Msg = "验证码不一致!"
             }));
         }
     }
     else
     {
         return(Json(new AjaxReault {
             Statin = "no", Msg = MVCHelper.GetValidMsg(ModelState)
         }));
     }
 }