예제 #1
0
        public ActionResult CheckLogin()
        {
            string validateCode = Session["validateCode"] == null ? string.Empty : Session["validateCode"].ToString();

            if (string.IsNullOrEmpty(validateCode))
            {
                return(Content("no:验证码错误!"));
            }
            Session["validateCode"] = null;
            string requestCode = Request["vCode"];

            if (!requestCode.Equals(validateCode, StringComparison.InvariantCultureIgnoreCase))
            {
                return(Content("no:验证码错误!!"));
            }
            string userName = Request["LoginCode"];
            string userPwd  = Request["LoginPwd"];

            BLL.UserInfoService UserInfoService = new BLL.UserInfoService();
            T_UserInfo          userInfo        = UserInfoService.GetUserInfoModel(userName, userPwd);

            if (userInfo != null)
            {
                return(Content("ok:登录成功!!"));
            }
            else
            {
                return(Content("no:用户名密码错误"));
            }
        }