From 17e4c7e3e7b3ef60d9da6de3b2a39a14a53c38a0 Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期三, 12 三月 2025 14:11:33 +0800
Subject: [PATCH] 1

---
 WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs
index ef2c23c..b335d72 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/LogAOP.cs
@@ -16,7 +16,7 @@
 namespace WIDESEAWCS_Core.AOP
 {
     /// <summary>
-	/// 鎷︽埅鍣˙logLogAOP 缁ф壙IInterceptor鎺ュ彛
+	/// 鎷︽埅鍣↙ogAOP 缁ф壙IInterceptor鎺ュ彛
 	/// </summary>
 	public class LogAOP : IInterceptor
     {
@@ -26,7 +26,6 @@
         {
             _accessor = accessor;
         }
-
 
         /// <summary>
         /// 瀹炰緥鍖朓Interceptor鍞竴鏂规硶 
@@ -38,7 +37,7 @@
             string json;
             try
             {
-                if(invocation.Arguments.Any())
+                if (invocation.Arguments.Any())
                 {
                     json = JsonConvert.SerializeObject(invocation.Arguments);
                 }
@@ -117,14 +116,13 @@
                     apiLogAopInfo.ResponseJsonData = jsonResult;
                     Parallel.For(0, 1, e =>
                     {
-                        LogLock.OutLogAOP("AOPLog", new string[] { apiLogAopInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopInfo) });
+                        LogLock.OutLogAOP("鍏ㄥ眬鏃ュ織AOP", new string[] { apiLogAopInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopInfo) });
                     });
                 }
             }
             catch (Exception ex) // 鍚屾2
             {
                 LogEx(ex, apiLogAopInfo);
-                throw;
             }
         }
 
@@ -136,12 +134,11 @@
             apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms";
             apiLogAopInfo.ResponseJsonData = JsonConvert.SerializeObject(o);
 
-
             await Task.Run(() =>
             {
                 Parallel.For(0, 1, e =>
                 {
-                    LogLock.OutLogAOP("AOPLog", new string[] { apiLogAopInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopInfo) });
+                    LogLock.OutLogAOP("鍏ㄥ眬鏃ュ織AOP", new string[] { apiLogAopInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopInfo) });
                 });
             });
         }
@@ -163,7 +160,7 @@
                 // 寮傚父鏃ュ織閲屾湁璇︾粏鐨勫爢鏍堜俊鎭�
                 Parallel.For(0, 1, e =>
                 {
-                    LogLock.OutLogAOP("AOPLogEx", new string[] { apiLogAopExInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopExInfo) });
+                    LogLock.OutLogAOP("鍏ㄥ眬寮傚父閿欒鏃ュ織AOP", new string[] { apiLogAopExInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopExInfo) });
                 });
             }
         }
@@ -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>
         /// 璇锋眰鍝嶅簲闂撮殧鏃堕棿

--
Gitblit v1.9.3