hutongqing
2024-10-15 0d07b90fd906e52ce486484aa53a6850983b1325
WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs
@@ -27,7 +27,6 @@
            _accessor = accessor;
        }
        /// <summary>
        /// 实例化IInterceptor唯一方法 
        /// </summary>
@@ -38,7 +37,7 @@
            string json;
            try
            {
                if(invocation.Arguments.Any())
                if (invocation.Arguments.Any())
                {
                    json = JsonConvert.SerializeObject(invocation.Arguments);
                }
@@ -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 });
        }
@@ -256,7 +251,7 @@
        /// <summary>
        /// 请求参数数据JSON
        /// </summary>
        [Description("请求参数数据JSON")]
        [Description("请求参数数据JSON")]
        public string RequestParamsData { get; set; } = string.Empty;
        /// <summary>
        /// 请求响应间隔时间