31 lines
955 B
C#
31 lines
955 B
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Text;
|
|||
|
|
|
|||
|
|
using NP.Base.ENUM;
|
|||
|
|
using System.Security.Claims;
|
|||
|
|
using System.Web.Mvc;
|
|||
|
|
using System.Linq;
|
|||
|
|
|
|||
|
|
namespace NP.Base.Auth
|
|||
|
|
{
|
|||
|
|
public class CFilter : ActionFilterAttribute
|
|||
|
|
{
|
|||
|
|
BaseController _base;
|
|||
|
|
public override void OnActionExecuting(ActionExecutingContext context)
|
|||
|
|
{
|
|||
|
|
Controller currentControll = context.Controller as Controller;
|
|||
|
|
_base = currentControll as BaseController;
|
|||
|
|
if (_base.SUserInfo.UserNo > 0)
|
|||
|
|
{
|
|||
|
|
base.OnActionExecuting(context);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//context.Result = new RedirectResult("/Account/NoAuth?_code="+ENUM.JSONCode.NoLogin+"&_msg=인증없음");
|
|||
|
|
context.Result = new RedirectResult("/Account/Index?_code=" + ENUM.JSONCode.NoLogin + "&_msg=인증없음");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|