示例#1
0
        /// <summary>
        /// 行为执行事件
        /// </summary>
        /// <param name="filterContext"></param>
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            VisitorTerminal vt = WebExtention.GetVisitorTerminal();

            if (vt.IsMobileTerminal)
            {
                //this.JumpMobileUrl(filterContext.RouteData, "");//跳转至移动网站
            }
            base.OnActionExecuting(filterContext);
        }
示例#2
0
        /// <summary>
        /// 授权失败处理
        /// </summary>
        /// <param name="actionContext"></param>
        /// <param name="vret">返回消息</param>
        private Task HandleUnauthorizedRequest(HttpActionContext actionContext, Result vret)
        {
            HttpResponseMessage response = new HttpResponseMessage();
            Result res = new Result(vret.Message, vret.Success);

            res.Status = vret.Status;

            response.Content       = new StringContent(JsonExtention.ToJsonString(res), Encoding.GetEncoding("UTF-8"), "application/json");
            response.StatusCode    = HttpStatusCode.OK;
            actionContext.Response = response;

            //授权失败,收集访问信息
            VisitorTerminal vt = AL.Common.Extention.WebExtention.GetVisitorTerminal();

            LogHelper.Info(vt);//存储
            return(Task.FromResult <object>(null));
        }
示例#3
0
        /// <summary>
        /// 收集信息
        /// </summary>
        /// <param name="Request"></param>
        public void Collection()
        {
            VisitorTerminal vt = WebExtention.GetVisitorTerminal();

            LogHelper.Info(vt);//存储
        }