From 8b7abd97e7b69800789134ed8e809e19a5b5ba74 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 17 九月 2025 00:30:27 +0800
Subject: [PATCH] 111

---
 util/DbHelperSQL.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/util/DbHelperSQL.cs b/util/DbHelperSQL.cs
index d950ee8..4778134 100644
--- a/util/DbHelperSQL.cs
+++ b/util/DbHelperSQL.cs
@@ -19,9 +19,15 @@
         // 鍒涘缓閰嶇疆鏋勫缓鍣�
         var builder = new ConfigurationBuilder()
             .SetBasePath(Directory.GetCurrentDirectory())
-            .AddJsonFile("appsettings.json", true, true);
+            .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
+            .AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true);
         // 鏋勫缓閰嶇疆
         var configuration = builder.Build();
+        // 淇閰嶇疆璺緞锛氬鏋滄槸DataBaseConn锛岄渶瑕佷粠AppSettings鑺傜偣璇诲彇
+        if (key == "DataBaseConn")
+        {
+            return configuration["AppSettings:DataBaseConn"];
+        }
         return configuration[key];
     }
 

--
Gitblit v1.9.3