hutongqing
2024-10-15 0d07b90fd906e52ce486484aa53a6850983b1325
WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs
@@ -27,7 +27,6 @@
            _accessor = accessor;
        }
        /// <summary>
        /// 实例化IInterceptor唯一方法 
        /// </summary>
@@ -136,7 +135,6 @@
            apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms";
            apiLogAopInfo.ResponseJsonData = JsonConvert.SerializeObject(o);
            await Task.Run(() =>
            {
                Parallel.For(0, 1, e =>
@@ -171,10 +169,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 +220,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 });
        }