protected override void OnActionExecuting(ActionExecutingContext filterContext){if (Request.Cookies["manage"] == null){
//重置路由吧算是filterContext.Result = RedirectToRoute("default", new { Controller = "Land", Action = "Index" });}base.OnActionExecuting(filterContext);}
在网上看到其他的解决方案:
filterContext.HttpContext.Response.Redirect("")//只需要加上filterContext.Result = new HttpUnauthorizedResult()//或者filterContext.Result = new EmptyResult()//filter验证不通过就不会执行action了,