62,025
社区成员
发帖
与我相关
我的任务
分享
public class RedirectingActionAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext context)
{
base.OnActionExecuting(context);
if (context.Controller.ToString() ==
"ProjectService.Web.Controllers.LoginController")
{
return;
}
if ((ProjectService.Core.IdentityContextHelper.Session.CompanyID == 0 ||
ProjectService.Core.IdentityContextHelper.Session.UserID == 0))
{
if (!DomainFacade.CreateLoginLogoutService().AttemptSignIn())
{
//context.Result = new RedirectResult("/Login/LoginIndex");
System.Web.HttpContext.Current.Response.Write(
@"<script type='text/javascript'language='javascript'>
top.window.location='/Login/LoginIndex'</script>");
System.Web.HttpContext.Current.Response.End();
}
}
}
}