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/Extensions/SqlsugarSetup.cs |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/SqlsugarSetup.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/SqlsugarSetup.cs
index a115f0e..0890671 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/SqlsugarSetup.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/SqlsugarSetup.cs
@@ -43,7 +43,7 @@
                         ConfigId = MainDb.CurrentDbConnId,
                         ConnectionString = DBContext.GetMainConnectionDb().Connection,
                         IsAutoCloseConnection = true,
-                        DbType = MainDb.DbType,
+                        DbType = DBContext.DbType,
                         AopEvents = new AopEvents
                         {
                             OnLogExecuting = (sql, p) =>
@@ -52,9 +52,12 @@
                                   {
                                         MiniProfiler.Current.CustomTiming("SQL锛�", GetParas(p) + "銆怱QL璇彞銆戯細" + sql);
                                   });
-                                Console.Out.WriteLine(GetParas(p));
-                                Console.Out.WriteLine(sql);
-                                Console.Out.WriteLine();
+                                if(AppSettings.GetValue("PrintSql").ObjToBool())
+                                {
+                                    Console.Out.WriteLine(GetParas(p));
+                                    Console.Out.WriteLine(sql);
+                                    Console.Out.WriteLine();
+                                }
                             }
                         },
                     }

--
Gitblit v1.9.3