|
|
|
@ -10,6 +10,7 @@ using Medallion.Threading; |
|
|
|
using Medallion.Threading.Redis; |
|
|
|
using Microsoft.AspNetCore.Authentication.JwtBearer; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Cors; |
|
|
|
using Microsoft.AspNetCore.DataProtection; |
|
|
|
using Microsoft.AspNetCore.Routing; |
|
|
|
using Microsoft.Extensions.Caching.StackExchangeRedis; |
|
|
|
@ -21,6 +22,7 @@ using Microsoft.OpenApi.Models; |
|
|
|
using StackExchange.Redis; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text.Encodings.Web; |
|
|
|
using System.Text.Unicode; |
|
|
|
using Volo.Abp; |
|
|
|
@ -352,6 +354,29 @@ public partial class WechatManagementHttpApiHostModule |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void ConfigureCors(IServiceCollection services, IConfiguration configuration) |
|
|
|
{ |
|
|
|
services.AddCors(options => |
|
|
|
{ |
|
|
|
options.AddDefaultPolicy(builder => |
|
|
|
{ |
|
|
|
builder |
|
|
|
.WithOrigins( |
|
|
|
configuration["App:CorsOrigins"] |
|
|
|
.Split(",", StringSplitOptions.RemoveEmptyEntries) |
|
|
|
.Select(o => o.RemovePostFix("/")) |
|
|
|
.ToArray() |
|
|
|
) |
|
|
|
.WithAbpExposedHeaders() |
|
|
|
.WithAbpWrapExposedHeaders() |
|
|
|
.SetIsOriginAllowedToAllowWildcardSubdomains() |
|
|
|
.AllowAnyHeader() |
|
|
|
.AllowAnyMethod() |
|
|
|
.AllowCredentials(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void ConfigureSecurity(IServiceCollection services, IConfiguration configuration, bool isDevelopment = false) |
|
|
|
{ |
|
|
|
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) |
|
|
|
|