public ActionResult LogIn(LoginViewModel model) { if(model.ValidateCode!="8888") throw new Exception("验证码错误!"); var user = _userService.Login(new LoginInfoInput{UserNameOrEmail=model.UserNameOrEmail, Password=model.Password}); if(user==null) throw new Exception("用户名或密码错误!"); _signInManager.SignIn(user.Id.ToString(), model.RememberMe); return AjaxOkResponse("登陆成功!"); }
public ActionResult LogIn(LoginViewModel model) { _signInManager.SignIn(model.UserName,model.RememberMe); return AjaxOkResponse("登陆成功!"); }