Esempio n. 1
0
        /// <summary>
        /// 当Action中标注了[SupportFilter]的时候会执行
        /// </summary>
        /// <param name="filterContext">请求上下文</param>
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            Account account = AccountModel.GetCurrentAccount();

            if (account == null)
            {
                //filterContext.HttpContext.Response.Write(" <script type='text/javascript'> window.top.location='Account'; </script>");
                //filterContext.Result = new EmptyResult();
                return;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取当前登陆人的账户信息
        /// </summary>
        /// <returns>账户信息</returns>
        public Account GetCurrentAccount()
        {
            var account = AccountModel.GetCurrentAccount();

            return(account);
        }