From 4e54aab4960fb97a549d9d715428b5374ecad6b5 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期二, 10 六月 2025 18:25:38 +0800
Subject: [PATCH] fix:运营端--订单管理--退款管理--列表数据导出文件不正确 运营端--订单管理--列表数据导出文件不正确

---
 LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
index 65763af..e35f536 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
+++ b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
@@ -170,13 +170,18 @@
             app.UseIdentityServer();
             app.UseAuthorization();
             app.UseAbpClaimsMap();
-#if DEBUG
-            app.UseSwagger();
-            app.UseSwaggerUI(options =>
+
+            var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
+            var openSwagger = configuration["OpenSwagger"].ToBoolOrNull();
+            if (openSwagger == true)
             {
-                options.SwaggerEndpoint("/swagger/v1/swagger.json", "LifePayment Service API");
-            });
-#endif
+                app.UseSwagger();
+                app.UseSwaggerUI(options =>
+                {
+                    options.SwaggerEndpoint("/swagger/v1/swagger.json", "LifePayment Service API");
+                });
+            }
+
             app.UseAuditing();
             app.UseConfiguredEndpoints();
             AsyncHelper.RunSync(async () =>

--
Gitblit v1.9.1