From 2aef482fa7431fb47eef94081ff23ec220f89820 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期五, 24 一月 2025 09:10:31 +0800
Subject: [PATCH] 1

---
 WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs
index 62dc38e..68ddb9f 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs
@@ -12,6 +12,7 @@
 using WIDESEAWCS_Core.BaseRepository;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
 
 namespace WIDESEAWCS_Core.Extensions
 {
@@ -22,8 +23,11 @@
             var basePath = AppContext.BaseDirectory;
             var cacheType = new List<Type>();
 
-            builder.RegisterType<LogAOP>();
-            cacheType.Add(typeof(LogAOP));
+            if (AppSettings.Get("LogAopEnable").ObjToBool())
+            {
+                builder.RegisterType<LogAOP>();
+                cacheType.Add(typeof(LogAOP));
+            }
 
             builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepository<>)).InstancePerDependency();//娉ㄥ唽浠撳偍
             builder.RegisterGeneric(typeof(ServiceBase<,>)).As(typeof(IService<>)).InstancePerDependency();//娉ㄥ唽鏈嶅姟
@@ -66,6 +70,8 @@
                .AsImplementedInterfaces()
                .InstancePerLifetimeScope()
                .PropertiesAutowired();
+
+            builder.RegisterType<RequestLogModel>().InstancePerLifetimeScope();
         }
     }
 }

--
Gitblit v1.9.3