修改BUG:登录页面脚本根据ReturnUrl进行跳转
This commit is contained in:
parent
854ec1d4eb
commit
c2b6291fa0
|
@ -29,7 +29,10 @@ 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() { IsPersistent = remember == "true" });
|
||||
return Redirect("~/");
|
||||
|
||||
// redirect origin url
|
||||
var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter];
|
||||
return Redirect(originUrl.Count == 1 ? originUrl[0] : "~/");
|
||||
}
|
||||
return View("Login", new ModelBase());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue