From ba0bb32b5fa844f57eb3b573dfb59fc0624c44a2 Mon Sep 17 00:00:00 2001 From: tyjctl <419999127@qq.com> Date: Wed, 18 Sep 2024 13:41:38 +0000 Subject: [PATCH] =?UTF-8?q?update=20Yi.Abp.Net8/module/rbac/Yi.Framework.R?= =?UTF-8?q?bac.Domain/Operlog/OperLogGlobalAttribute.cs.=20OperLog?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tyjctl <419999127@qq.com> --- .../Operlog/OperLogGlobalAttribute.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Operlog/OperLogGlobalAttribute.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Operlog/OperLogGlobalAttribute.cs index 1bb5120a..5fe93cb3 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Operlog/OperLogGlobalAttribute.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Operlog/OperLogGlobalAttribute.cs @@ -1,8 +1,9 @@ -using IPTools.Core; +using IPTools.Core; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; using Volo.Abp.Users; @@ -25,9 +26,9 @@ namespace Yi.Framework.Rbac.Domain.Operlog _currentUser = currentUser; } - public override async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) + public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { - var resultContext = await next.Invoke(); + var resultContext = await next(); //执行后 //判断标签是在方法上 @@ -84,7 +85,8 @@ namespace Yi.Framework.Rbac.Domain.Operlog if (operLogAttribute.IsSaveRequestData) { //不建议保存,吃性能 - //logEntity.RequestParam = context.HttpContext.GetRequestValue(logEntity.RequestMethod); + //保存请求参数 + logEntity.RequestParam = JsonConvert.SerializeObject(context.ActionArguments); } await _repository.InsertAsync(logEntity);