Browse Source
1. Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy替换为Volo.Abp.AspNetCore.MultiTenancy 2. 移除多余Volo.Abp.AspNetCore.Authentication.JwtBearer依赖 3. 调整redis配置通过setting配置 4. 调整configservice 5. 优化模板main
54 changed files with 335 additions and 318 deletions
|
After Width: | Height: | Size: 2.1 KiB |
@ -1,67 +1,56 @@ |
|||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(MyProjectNameHttpApiModule), |
||||
|
typeof(AbpProAspNetCoreModule), |
||||
|
typeof(MyProjectNameEntityFrameworkCoreModule), |
||||
|
typeof(AbpAspNetCoreSerilogModule), |
||||
|
typeof(AbpAccountWebModule), |
||||
|
typeof(MyProjectNameApplicationModule), |
||||
|
typeof(AbpCachingStackExchangeRedisModule), |
||||
|
typeof(AbpBlobStoringFileSystemModule) |
||||
|
)] |
||||
|
public class MyProjectNameHttpApiHostModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
typeof(MyProjectNameHttpApiModule), |
|
||||
typeof(AbpProAspNetCoreModule), |
|
||||
typeof(AbpAspNetCoreMvcUiMultiTenancyModule), |
|
||||
typeof(MyProjectNameEntityFrameworkCoreModule), |
|
||||
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), |
|
||||
typeof(AbpAspNetCoreSerilogModule), |
|
||||
typeof(AbpAccountWebModule), |
|
||||
typeof(MyProjectNameApplicationModule), |
|
||||
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
|
||||
typeof(AbpCachingStackExchangeRedisModule) |
|
||||
)] |
|
||||
public class MyProjectNameHttpApiHostModule : AbpModule |
|
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
context.Services |
||||
{ |
.AddAbpProAuditLog() |
||||
context.Services |
.AddAbpProJwtBearer() |
||||
.AddAbpProAuditLog() |
.AddAbpProMultiTenancy() |
||||
.AddAbpProAuthentication() |
.AddAbpProRedis() |
||||
.AddAbpProMultiTenancy() |
.AddAbpProMiniProfiler() |
||||
.AddAbpProRedis() |
.AddAbpProCors() |
||||
.AddAbpProRedisDistributedLocking() |
.AddAbpProAntiForgery() |
||||
.AddAbpProMiniProfiler() |
.AddAbpProIdentity() |
||||
.AddAbpProCors() |
.AddAbpProSignalR() |
||||
.AddAbpProAntiForgery() |
.AddAbpProHealthChecks() |
||||
.AddAbpProIdentity() |
.AddAbpProTenantResolvers() |
||||
.AddAbpProSignalR() |
.AddAbpProLocalization() |
||||
.AddAbpProHealthChecks() |
.AddAbpProExceptions() |
||||
.AddAbpProTenantResolvers() |
.AddAbpProSwagger("AbpPro"); |
||||
.AddAbpProLocalization() |
} |
||||
.AddAbpProExceptions() |
|
||||
.AddAbpProSwagger("AbpPro"); |
|
||||
} |
|
||||
|
|
||||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
||||
|
{ |
||||
|
var app = context.GetApplicationBuilder(); |
||||
|
app.UseAbpProRequestLocalization(); |
||||
|
app.UseCorrelationId(); |
||||
|
app.MapAbpStaticAssets(); |
||||
|
app.UseAbpProMiniProfiler(); |
||||
|
app.UseRouting(); |
||||
|
app.UseAbpProCors(); |
||||
|
app.UseAuthentication(); |
||||
|
app.UseAbpProMultiTenancy(); |
||||
|
app.UseAuthorization(); |
||||
|
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json","AbpPro"); |
||||
|
app.UseAbpProAuditing(); |
||||
|
app.UseAbpSerilogEnrichers(); |
||||
|
app.UseUnitOfWork(); |
||||
|
app.UseConfiguredEndpoints(endpoints => |
||||
{ |
{ |
||||
var app = context.GetApplicationBuilder(); |
endpoints.MapHealthChecks("/health"); |
||||
app.UseAbpProRequestLocalization(); |
}); |
||||
app.UseCorrelationId(); |
app.UseAbpProConsul(); |
||||
app.MapAbpStaticAssets(); |
|
||||
app.UseAbpProMiniProfiler(); |
|
||||
app.UseRouting(); |
|
||||
app.UseAbpProCors(); |
|
||||
app.UseAuthentication(); |
|
||||
app.UseAbpProMultiTenancy(); |
|
||||
app.UseAuthorization(); |
|
||||
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json","AbpPro"); |
|
||||
app.UseAbpProAuditing(); |
|
||||
app.UseAbpSerilogEnrichers(); |
|
||||
app.UseUnitOfWork(); |
|
||||
app.UseConfiguredEndpoints(endpoints => |
|
||||
{ |
|
||||
endpoints.MapHealthChecks("/health"); |
|
||||
|
|
||||
// endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions()
|
|
||||
// {
|
|
||||
// Authorization = new[] { new CustomHangfireAuthorizeFilter() },
|
|
||||
// IgnoreAntiforgeryToken = true
|
|
||||
// });
|
|
||||
|
|
||||
}); |
|
||||
app.UseAbpProConsul(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,68 @@ |
|||||
|
{ |
||||
|
"ConnectionStrings": { |
||||
|
//"Default": "Data Source=localhost;Port=3306;Database=LionAbpProDemo9;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
||||
|
"Default": "User ID=postgres;Password=1q2w3E*;Host=localhost;Port=5432;Database=LionAbpProDb;" |
||||
|
}, |
||||
|
"Hangfire": { |
||||
|
"Redis": { |
||||
|
"Host": "localhost:6379,password=1q2w3E*", |
||||
|
"DB": "2" |
||||
|
} |
||||
|
}, |
||||
|
"Redis": { |
||||
|
"IsEnabled": false, |
||||
|
"Configuration": "localhost:6379,password=1q2w3E*,defaultdatabase=2" |
||||
|
}, |
||||
|
"Jwt": { |
||||
|
"Audience": "Lion.AbpPro", |
||||
|
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", |
||||
|
"Issuer": "Lion.AbpPro", |
||||
|
"ExpirationTime": 2 |
||||
|
}, |
||||
|
"Cap": { |
||||
|
"RabbitMq": { |
||||
|
"HostName": "localhost", |
||||
|
"UserName": "admin", |
||||
|
"Password": "1q2w3E*", |
||||
|
"Port": 5672 |
||||
|
} |
||||
|
}, |
||||
|
"ElasticSearch": { |
||||
|
"Host": "http://es.cn", |
||||
|
"UserName": "elastic", |
||||
|
"Password": "aVVhjQ95RP7nbwNy" |
||||
|
}, |
||||
|
"MiniProfiler": { |
||||
|
"Enabled": true, |
||||
|
"RouteBasePath": "/profiler" |
||||
|
}, |
||||
|
"Swagger": { |
||||
|
"Enabled": true |
||||
|
}, |
||||
|
"Audit": { |
||||
|
"Enabled": true, |
||||
|
"ApplicationName": "Lion.AbpPro" |
||||
|
}, |
||||
|
"Cors": { |
||||
|
"Enabled": true, |
||||
|
"CorsOrigins": "http://localhost:4200,http://localhost:4201" |
||||
|
}, |
||||
|
"Consul": { |
||||
|
"Enabled": false, |
||||
|
"ServiceUrl": "http://localhost:8500", |
||||
|
"ClientName": "Lion.AbpPro.Api", |
||||
|
"ClientAddress": "localhost", |
||||
|
"ClientPort": 44315, |
||||
|
"HealthUrl": "http://localhost:44315/health", |
||||
|
"DeregisterCriticalServiceAfter": 30, |
||||
|
"Interval": 30, |
||||
|
"Timeout": 30 |
||||
|
}, |
||||
|
"MultiTenancy": { |
||||
|
"Enabled": true |
||||
|
}, |
||||
|
"Preheat": { |
||||
|
"Enabled": true, |
||||
|
"RequestUrl": "http://localhost:44315/api/abp/application-configuration?IncludeLocalizationResources=false" |
||||
|
} |
||||
|
} |
||||
|
After Width: | Height: | Size: 2.1 KiB |
Loading…
Reference in new issue