/// <summary> /// 登录前 /// </summary> /// <param name="filterContext">过滤上下文</param> public override void OnActionExecuting(ActionExecutingContext filterContext) { try { UserInfo admin = UserOperate.GetSuperAdmin(); //获取管理员信息 string username = filterContext.ActionArguments["username"].ObjToStr(); loginLog.UserId = UserOperate.GetUserIdByUserName(username).ObjToStr(); loginLog.LoginName = username; loginLog.LoginTime = DateTime.Now; loginLog.LoginIp = WebHelper.GetClientIP(filterContext.HttpContext.Request); loginLog.CreateUserId = admin.UserId; //添加人默认为空 loginLog.CreateDate = DateTime.Now; loginLog.CreateUserName = admin.AliasName; loginLog.ModifyUserId = admin.UserId; //修改人默认为空 loginLog.ModifyDate = DateTime.Now; loginLog.ModifyUserName = admin.AliasName; } catch { } }