From 5a09f64b974521e25ef07c0691361ba5d71e919b Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 16 四月 2025 17:18:37 +0800 Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/LifePaymentApi --- LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs index ede9205..65763af 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(); - ConfigureConventionalControllers(); + 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) @@ -186,10 +190,19 @@ }); } - private void ConfigureConventionalControllers() + private void ConfigurePays(ServiceConfigurationContext context, IConfiguration configuration) { + Configure<WxPayOption>(configuration.GetSection("WxPay")); + context.Services.AddHttpClient(LifePaymentConstant.WxPayHttpClientName, config => + { + config.Timeout = TimeSpan.FromSeconds(120); + config.DefaultRequestHeaders.Add("Connection", "Keep-Alive"); + config.DefaultRequestHeaders.Add("User-Agent", "Aop4Net"); + config.DefaultRequestHeaders.Add("Accept", "application/json"); + }); + Configure<Config>(configuration.GetSection("AliPay")); + PostConfigure<Config>(r => { Factory.SetOptions(r); }); } - } } \ No newline at end of file -- Gitblit v1.9.1