From 4da9abd0564a60e1076f02e8a6755555fb87e3ae Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 13 Mar 2019 18:25:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=9AAc?= =?UTF-8?q?countController=E6=8E=A7=E5=88=B6=E5=99=A8Login=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=87=8F=E5=B0=91=E4=B8=80=E6=AC=A1Redirect=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=BF=94=E5=9B=9E=E7=99=BB=E5=BD=95=E6=9C=AA=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Controllers/AccountController.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bootstrap.Admin/Controllers/AccountController.cs b/Bootstrap.Admin/Controllers/AccountController.cs index 850b7499..0aca2d20 100644 --- a/Bootstrap.Admin/Controllers/AccountController.cs +++ b/Bootstrap.Admin/Controllers/AccountController.cs @@ -47,10 +47,11 @@ namespace Bootstrap.Admin.Controllers var identity = new ClaimsIdentity(CookieAuthenticationDefaults.AuthenticationScheme); identity.AddClaim(new Claim(ClaimTypes.Name, userName)); await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity), new AuthenticationProperties { ExpiresUtc = DateTimeOffset.Now.AddDays(DictHelper.RetrieveCookieExpiresPeriod()), IsPersistent = remember == "true" }); + // redirect origin url + var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].FirstOrDefault() ?? "~/Home/Index"; + return Redirect(originUrl); } - // redirect origin url - var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].FirstOrDefault() ?? "~/Home/Index"; - return Redirect(originUrl); + return View("Login", new ModelBase()); } ///