增加功能:内部出错时,根据ReturnUrl参数返回
This commit is contained in:
parent
5494eae930
commit
24ae7e570f
|
@ -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>
|
||||
|
|
|
@ -13,5 +13,5 @@
|
|||
<h1>网页拒绝访问</h1>
|
||||
<h3>您无权访问本页面请联系网站管理员授权后再查看</h3>
|
||||
<br />
|
||||
<a href="~/Home/Index" target="_top">返回首页</a>
|
||||
<a href="@ViewBag.ReturnUrl" target="_top">返回首页</a>
|
||||
</section>
|
Loading…
Reference in New Issue