|
|
@ -11,6 +11,7 @@ using Ocelot.Middleware.Multiplexer; |
|
|
using Ocelot.Provider.Polly; |
|
|
using Ocelot.Provider.Polly; |
|
|
using StackExchange.Redis; |
|
|
using StackExchange.Redis; |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Text; |
|
|
using Volo.Abp; |
|
|
using Volo.Abp; |
|
|
using Volo.Abp.AspNetCore; |
|
|
using Volo.Abp.AspNetCore; |
|
|
using Volo.Abp.Autofac; |
|
|
using Volo.Abp.Autofac; |
|
|
@ -20,6 +21,7 @@ using Volo.Abp.Caching.StackExchangeRedis; |
|
|
using Volo.Abp.Http.Client.IdentityModel; |
|
|
using Volo.Abp.Http.Client.IdentityModel; |
|
|
using Volo.Abp.IdentityModel; |
|
|
using Volo.Abp.IdentityModel; |
|
|
using Volo.Abp.Modularity; |
|
|
using Volo.Abp.Modularity; |
|
|
|
|
|
using Volo.Abp.Security.Encryption; |
|
|
|
|
|
|
|
|
namespace LINGYUN.ApiGateway |
|
|
namespace LINGYUN.ApiGateway |
|
|
{ |
|
|
{ |
|
|
@ -100,6 +102,22 @@ namespace LINGYUN.ApiGateway |
|
|
options.InstanceName = configuration["Redis:InstanceName"]; |
|
|
options.InstanceName = configuration["Redis:InstanceName"]; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 加解密
|
|
|
|
|
|
Configure<AbpStringEncryptionOptions>(options => |
|
|
|
|
|
{ |
|
|
|
|
|
var encryptionConfiguration = configuration.GetSection("Encryption"); |
|
|
|
|
|
if (encryptionConfiguration.Exists()) |
|
|
|
|
|
{ |
|
|
|
|
|
options.DefaultPassPhrase = encryptionConfiguration["PassPhrase"] ?? options.DefaultPassPhrase; |
|
|
|
|
|
options.DefaultSalt = encryptionConfiguration.GetSection("Salt").Exists() |
|
|
|
|
|
? Encoding.ASCII.GetBytes(encryptionConfiguration["Salt"]) |
|
|
|
|
|
: options.DefaultSalt; |
|
|
|
|
|
options.InitVectorBytes = encryptionConfiguration.GetSection("InitVector").Exists() |
|
|
|
|
|
? Encoding.ASCII.GetBytes(encryptionConfiguration["InitVector"]) |
|
|
|
|
|
: options.InitVectorBytes; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Configure<IdentityModelHttpRequestMessageOptions>(options => |
|
|
Configure<IdentityModelHttpRequestMessageOptions>(options => |
|
|
{ |
|
|
{ |
|
|
// See https://github.com/abpframework/abp/pull/4564
|
|
|
// See https://github.com/abpframework/abp/pull/4564
|
|
|
|