From d045e42a317288fa3082d8897e7a87960f5781f5 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Fri, 6 Sep 2024 10:03:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs | 10 ++++++---- src/Shentun.Peis.HttpApi.Host/appsettings.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs index 5f745b9..0dc84fb 100644 --- a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs +++ b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs @@ -119,7 +119,7 @@ public class PeisHttpApiHostModule : AbpModule builder.SetAccessTokenLifetime(TimeSpan.FromDays(30)).SetRefreshTokenLifetime(TimeSpan.FromDays(60)); //导入自定义证书,低版本windows要用openssl1.1.1生成 builder.AddEncryptionCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\encryption-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet)); - builder.AddSigningCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\signing-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet)); + builder.AddSigningCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\signing-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet)); }); @@ -209,17 +209,19 @@ public class PeisHttpApiHostModule : AbpModule //context.Services.TryAddTransient(); - + ///解除https限制 context.Services.AddOpenIddict() .AddServer(option => { - option.SetIssuer(new Uri(configuration["AuthServer:IssuerBase"])); + string issuerBase = configuration["AuthServer:IssuerBase"]; + if (!string.IsNullOrWhiteSpace(issuerBase)) + option.SetIssuer(new Uri(issuerBase)); option.UseAspNetCore().DisableTransportSecurityRequirement(); }); - + //虚拟目录 context.Services.AddSingleton(new MyFileProvider(configuration["VirtualPath:RealPath"], configuration["VirtualPath:Alias"])); diff --git a/src/Shentun.Peis.HttpApi.Host/appsettings.json b/src/Shentun.Peis.HttpApi.Host/appsettings.json index 6732c07..a298b60 100644 --- a/src/Shentun.Peis.HttpApi.Host/appsettings.json +++ b/src/Shentun.Peis.HttpApi.Host/appsettings.json @@ -12,7 +12,7 @@ }, "ConnectionStrings": { //"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123;" - "Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;", + "Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;" //"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;" }, "AuthServer": {