|
|
@ -49,6 +49,8 @@ using static Org.BouncyCastle.Math.EC.ECCurve; |
|
|
using System.Security.Cryptography.X509Certificates; |
|
|
using System.Security.Cryptography.X509Certificates; |
|
|
using Microsoft.Extensions.Hosting.Internal; |
|
|
using Microsoft.Extensions.Hosting.Internal; |
|
|
using Microsoft.IdentityModel.Tokens; |
|
|
using Microsoft.IdentityModel.Tokens; |
|
|
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
|
|
using Microsoft.AspNetCore.Http.Features; |
|
|
|
|
|
|
|
|
namespace Shentun.WebPeis; |
|
|
namespace Shentun.WebPeis; |
|
|
|
|
|
|
|
|
@ -159,7 +161,7 @@ public class WebPeisHttpApiHostModule : AbpModule |
|
|
{ |
|
|
{ |
|
|
x.JsonSerializerOptions.PropertyNameCaseInsensitive = true; |
|
|
x.JsonSerializerOptions.PropertyNameCaseInsensitive = true; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.Services.AddOptions<AbpOpenIddictExtensionGrantsOptions>() |
|
|
context.Services.AddOptions<AbpOpenIddictExtensionGrantsOptions>() |
|
|
.Configure<IServiceProvider>((options, serviceProvider) => |
|
|
.Configure<IServiceProvider>((options, serviceProvider) => |
|
|
{ |
|
|
{ |
|
|
@ -168,7 +170,7 @@ public class WebPeisHttpApiHostModule : AbpModule |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Configure<OpenIddictServerAspNetCoreBuilder>(configure =>
|
|
|
//Configure<OpenIddictServerAspNetCoreBuilder>(configure =>
|
|
|
//{
|
|
|
//{
|
|
|
@ -189,7 +191,7 @@ public class WebPeisHttpApiHostModule : AbpModule |
|
|
|
|
|
|
|
|
private void ConfigureAuthentication(ServiceConfigurationContext context) |
|
|
private void ConfigureAuthentication(ServiceConfigurationContext context) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); |
|
|
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); |
|
|
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options => |
|
|
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options => |
|
|
{ |
|
|
{ |
|
|
@ -293,7 +295,7 @@ public class WebPeisHttpApiHostModule : AbpModule |
|
|
|
|
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var app = context.GetApplicationBuilder(); |
|
|
var app = context.GetApplicationBuilder(); |
|
|
var env = context.GetEnvironment(); |
|
|
var env = context.GetEnvironment(); |
|
|
@ -310,6 +312,17 @@ public class WebPeisHttpApiHostModule : AbpModule |
|
|
app.UseErrorPage(); |
|
|
app.UseErrorPage(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//post´óСÏÞÖÆ
|
|
|
|
|
|
app.UseWhen(ct => ct.Request.Method == HttpMethods.Post, |
|
|
|
|
|
builder => builder.UseWhen(ct => true, appBuilder => |
|
|
|
|
|
appBuilder.Use((ct, next) => |
|
|
|
|
|
{ |
|
|
|
|
|
ct.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 50 * 1024 * 1024; // 10MB
|
|
|
|
|
|
return next(); |
|
|
|
|
|
}))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.UseCorrelationId(); |
|
|
app.UseCorrelationId(); |
|
|
app.UseStaticFiles(); |
|
|
app.UseStaticFiles(); |
|
|
//ÐéÄâĿ¼
|
|
|
//ÐéÄâĿ¼
|
|
|
|