1
hutongqing
2025-01-02 8c6fd742db249ad4cc819cf041eb98d880a3ef73
WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs
@@ -16,7 +16,7 @@
namespace WIDESEAWCS_Core.AOP
{
    /// <summary>
   /// 拦截器BlogLogAOP 继承IInterceptor接口
   /// 拦截器LogAOP 继承IInterceptor接口
   /// </summary>
   public class LogAOP : IInterceptor
    {
@@ -26,7 +26,6 @@
        {
            _accessor = accessor;
        }
        /// <summary>
        /// 实例化IInterceptor唯一方法 
@@ -38,7 +37,7 @@
            string json;
            try
            {
                if(invocation.Arguments.Any())
                if (invocation.Arguments.Any())
                {
                    json = JsonConvert.SerializeObject(invocation.Arguments);
                }
@@ -124,7 +123,6 @@
            catch (Exception ex) // 同步2
            {
                LogEx(ex, apiLogAopInfo);
                throw;
            }
        }
@@ -135,7 +133,6 @@
            apiLogAopInfo.ResponseTime = endTime.ToString("yyyy-MM-dd hh:mm:ss fff");
            apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms";
            apiLogAopInfo.ResponseJsonData = JsonConvert.SerializeObject(o);
            await Task.Run(() =>
            {
@@ -171,10 +168,7 @@
        public static bool IsAsyncMethod(MethodInfo method)
        {
            return
                method.ReturnType == typeof(Task) ||
                method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>)
            ;
            return method.ReturnType == typeof(Task) || method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>);
        }
    }
@@ -225,7 +219,7 @@
            Func<object, Task> action, Action<Exception> finalAction)
        {
            return typeof(InternalAsyncHelper)
                .GetMethod("AwaitTaskWithPostActionAndFinallyAndGetResult", BindingFlags.Public | BindingFlags.Static)
                .GetMethod(nameof(AwaitTaskWithPostActionAndFinallyAndGetResult), BindingFlags.Public | BindingFlags.Static)
                .MakeGenericMethod(taskReturnType)
                .Invoke(null, new object[] { actualReturnValue, action, finalAction });
        }
@@ -256,7 +250,7 @@
        /// <summary>
        /// 请求参数数据JSON
        /// </summary>
        [Description("请求参数数据JSON")]
        [Description("请求参数数据JSON")]
        public string RequestParamsData { get; set; } = string.Empty;
        /// <summary>
        /// 请求响应间隔时间