Beispiel #1
0
        private dynamic DoLogin()
        {
            var user = _userDb.Login(Request.Form.username, Request.Form.password);

            if (user == null)
            {
                ViewBag.Error = "用户名或密码错误!";
                return(View["user/login"]);
            }
            else
            {
                User = user;
                return(new RedirectResponse(Request.Form.returnurl == null ? "/user" : Request.Form.returnurl));
            }
        }