Browse Source

签名

master
wxd 1 year ago
parent
commit
d045e42a31
  1. 10
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  2. 2
      src/Shentun.Peis.HttpApi.Host/appsettings.json

10
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<IAuthorizationMiddlewareResultHandler, AuthorizationMiddlewareResultHandler>();
///解除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"]));

2
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": {

Loading…
Cancel
Save