From 7a540f529d2c9a541993bc9818cad9c9093fec91 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 03 十二月 2025 11:04:35 +0800
Subject: [PATCH] fix: bug
---
LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
index f29bd19..e35f536 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
+++ b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
@@ -54,7 +54,7 @@
//Configure<AliYunSMSSettingOptions>(configuration.GetSection("AliYunSMSSetting"));
context.Services.AddAutoMapperObjectMapper();
-
+ ConfigurePays(context, configuration);
context.Services.AddAuthentication("Bearer").AddIdentityServerAuthentication(options =>
{
options.Authority = configuration["AuthServer:Authority"];
@@ -119,7 +119,7 @@
});
Configure<AbpAuditingOptions>(options =>
{
- options.IsEnabledForGetRequests = false;
+ options.IsEnabledForGetRequests = true;
options.ApplicationName = "LifePaymentService";
});
Configure<AbpUnitOfWorkOptions>(options =>
@@ -149,7 +149,11 @@
cacheOptions.KeyPrefix = "LifePaymentServices_";
cacheOptions.GlobalCacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(20);
});
+ this.Configure<OssSettings>(configuration.GetSection("ossSettings"));
this.Configure<ACOOLYOption>(configuration.GetSection("ACOOLY"));
+ this.Configure<Config>("AliPayEcsign", configuration.GetSection("AliPayEcsign"));
+ this.Configure<InformationOption>(configuration.GetSection("WeiXinCgi"));
+ this.Configure<InitSetting>(configuration.GetSection("InitSetting"));
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
@@ -166,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