public ActionResult Index(LogInModel model)
        {
            if (ModelState.IsValid)
            {
                if (Member.Login(model.UserName, model.Password, Request.UserHostAddress).Key)
                {
                    return RedirectToAction("Index", "Home", new { area = "Ma" });
                }
            }

            ModelState.AddModelError("", "用户名或密码错误");
            return View(model);
        }
        public ActionResult Login(LogInModel model)
        {
            if (ModelState.IsValid)
            {
                if (Member.Login(model.UserName, model.Password, Request.UserHostAddress,true))
                {
                    var u = Member.GetCurrentUserInfoFromCache();
                    if (u.ShopId > 0)
                    {
                        return RedirectToAction("Index", "Home");
                    }
                }
            }

            return View(model);
        }
        public ActionResult Index(LogInModel model)
        {
            if (ModelState.IsValid)
            {
                if (Member.Login(model.UserName, model.Password, Request.UserHostAddress).Key)
                {
                    var u = Member.GetLoginMember();
                    if (u.OwnedSupplier.Contains(GlobeInfo.InitiatedShopId))
                    {
                        return RedirectToAction("Index", "Home", new { area = "Fenxiao" });
                    }
                }
            }

            ModelState.AddModelError("", "用户名或密码错误");
            return View(model);
        }
Beispiel #4
0
        public ActionResult PrepaidCardLogin(LogInModel model, string returnUrl, string Path)
        {
            if (Member.ShopLogin(model.UserName, model.Password, Request.UserHostAddress))
            {
                var u = Member.GetCurrentUserInfoInShopToken();
                if (u.ShopId > 0)
                {
                    return RedirectToAction("Index", "Home", new { area = "ShopMange" });
                }
            }

            ModelState.AddModelError("", "用户名或密码错误");

            return View("Login", model);
        }
Beispiel #5
0
        public ActionResult Login(LogInModel model, string returnUrl, string path)
        {
            if (returnUrl.IsEmpty() && !path.IsEmpty())
            {
                returnUrl = path;
            }

            var result = false;
            if (ModelState.IsValid)
            {
                var u =
                 YunClient.Instance.Execute(new VerificationPrepaidCardRequest
               {
                CardNumber = model.UserName,
                CardPassword = model.Password,
                AppSecret = YunClient.AppSecret,
               });
                if(u.PrepaidCard!=null)
                {
                    if (u.PrepaidCard.BindUserId <= 0)
                    {
                        PrepaidCardUserName = model.UserName;
                        PrepaidCardUserPassword = model.Password;
                        PrepaidCardId = u.PrepaidCard.PrepaidCardId;
                        cardShopId = u.PrepaidCard.BindshopId;
                        return RedirectToAction("Registration", new { path = returnUrl });
                    }
                    else
                    {
                        ModelState.AddModelError("", "此卡已绑定,请用手机号/邮箱登录");
                        return View(model);
                    }

                }
                //先使用充值卡登录
                if (!result)
                {
                    result = Member.Login(model.UserName, model.Password, Request.UserHostAddress,false);
                }

                if (result)
                {
                    if (!returnUrl.IsEmpty() && !returnUrl.Contains("logout"))
                    {
                        return Redirect(HttpUtility.UrlDecode(returnUrl));
                    }

                    return RedirectToAction("Index");

                    //var u = Member.GetCurrentUserInfoFromCache();
                    //return RedirectToAction("Index", "Home", u.ShopId > 0 ? new {area = "Admin"} : new {area = ""});
                }
                ModelState.AddModelError("", "用户名或密码错误");

            }
            return View(model);
        }
        public ActionResult NormalLogin(LogInModel model,string returnUrl)
        {
            if (ModelState.IsValid)
            {
                if (Member.Login(model.UserName, model.Password, Request.UserHostAddress).Key)
                {
                    if (!returnUrl.IsEmpty())
                    {
                        return Redirect(returnUrl);
                    }

                    return RedirectToAction("Index", "My", new { area = "Mobile" });
                }
            }

            ModelState.AddModelError("LoginError", "用户名或密码错误");
            return View(model);
        }
        public ActionResult Login(LogInModel model, string returnUrl, string Path)
        {
            if (ModelState.IsValid)
            {
                if (Member.Login(model.UserName, model.Password, Request.UserHostAddress,false))
                {
                    if (!returnUrl.IsEmpty() && !returnUrl.Contains("logout"))
                    {

                        return Redirect(returnUrl);
                    }
                    if (!Path.IsEmpty() && !Path.Contains("logout"))
                    {
                        return Redirect(Path);
                    }
                    var u = Member.GetCurrentUserInfoFromCache();
                    return RedirectToAction("Index", "Home", u.ShopId > 0 ? new {area = "Admin"} : new {area = ""});
                }
                ModelState.AddModelError("", "用户名或密码错误");
            }
            return View(model);
        }