Esempio n. 1
0
        public ActionResult StudentLogin()
        {
            if (UCHomeBasePage.IsLogin)
            {
                return(RedirectToAction("Index", "Home"));
            }
            string         UserName = "******", UserPwd = "111111";
            UCHome_UserBLL userbll = new UCHome_UserBLL();

            UserPwd = EncryptUtils.MD5Encrypt(UserPwd);
            Guid userid = Guid.Empty;

            userbll.CheckUser(UserName, UserPwd, out userid);
            string transferurl = string.Format("{0}Login/loginTransfer?uchomereturnurl={1}&UserID={2}", UCHomeBasePage.iiswebsitedirectory, Url.Action("HomePage", "Home"), userid);

            return(Redirect(transferurl));
        }
Esempio n. 2
0
        public JsonResult CheckLogin(string UserName, string UserPwd)
        {
            UCHome_UserBLL userbll = new UCHome_UserBLL();

            UserPwd = EncryptUtils.MD5Encrypt(UserPwd);
            if (userbll.CheckUser(UserName, UserPwd, out Guid useid))
            {
                JsonResult result = new JsonResult
                {
                    Data = new { StatusCode = 200, ErrorMessage = "", UserID = useid }
                };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                JsonResult result = new JsonResult
                {
                    Data = new { StatusCode = 400, ErrorMessage = "帐号密码错误", UserID = "" }
                };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }