Exemple #1
0
        //登录 获取用户信息从数据库中验证
        public ActionResult Login(User user)
        {
            UserSql us = new UserSql();

            if (us.judgeUser(user))
            {
                User u = us.getUserInfo(user);
                //应该验证是否封号

                if (u.User_State == 0)
                {
                    //return 封号view;
                    return(View("IdBlocked"));
                }

                Session["LoginState"] = "已登录";
                //获取用户的所有信息.  存放session
                Session["user"] = (User)u;
                return(RedirectToAction("Index", "FFTXIndex"));
            }
            else
            {
                return(View("LoginFail"));
            }
        }