增加功能:内部出错时,根据ReturnUrl参数返回

This commit is contained in:
Argo-MacBookPro 2018-10-20 19:34:20 +08:00
parent 5494eae930
commit 24ae7e570f
2 changed files with 3 additions and 1 deletions

View File

@ -65,6 +65,8 @@ namespace Bootstrap.Admin.Controllers
[ResponseCache(Duration = 600)]
public ActionResult AccessDenied()
{
var returnUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].ToString();
ViewBag.ReturnUrl = string.IsNullOrEmpty(returnUrl) ? Url.Content("~/Home/Index") : returnUrl;
return View();
}
/// <summary>

View File

@ -13,5 +13,5 @@
<h1>网页拒绝访问</h1>
<h3>您无权访问本页面请联系网站管理员授权后再查看</h3>
<br />
<a href="~/Home/Index" target="_top">返回首页</a>
<a href="@ViewBag.ReturnUrl" target="_top">返回首页</a>
</section>