Compare commits
1 Commits
c667df1ce3
...
dv_karl
| Author | SHA1 | Date | |
|---|---|---|---|
| fdfb005974 |
44
KonSoft.sln
44
KonSoft.sln
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.14.36414.22
|
VisualStudioVersion = 17.14.36414.22 d17.14
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "applications", "applications", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "applications", "applications", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -49,6 +49,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E67FA5C3-132
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1C06151A-45F0-4D48-8303-3D4CBE9517F7}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1C06151A-45F0-4D48-8303-3D4CBE9517F7}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared", "shared\KonSoft.Shared\KonSoft.Shared.csproj", "{345B5CDA-DC77-4956-BF96-80707EC1B5B2}"
|
||||||
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Admin.Application", "modules\admin\src\KonSoft.Admin.Application\KonSoft.Admin.Application.csproj", "{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Admin.Application", "modules\admin\src\KonSoft.Admin.Application\KonSoft.Admin.Application.csproj", "{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Admin.Application.Contracts", "modules\admin\src\KonSoft.Admin.Application.Contracts\KonSoft.Admin.Application.Contracts.csproj", "{9F68B0E2-0B1D-E0E8-1BE7-079F693A4643}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Admin.Application.Contracts", "modules\admin\src\KonSoft.Admin.Application.Contracts\KonSoft.Admin.Application.Contracts.csproj", "{9F68B0E2-0B1D-E0E8-1BE7-079F693A4643}"
|
||||||
@ -183,16 +185,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Report.HttpApi.Host
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.TenantManagement.HttpApi.Host", "microservices\KonSoft.TenantManagement.HttpApi.Host\KonSoft.TenantManagement.HttpApi.Host.csproj", "{3641CA05-99C5-2245-C663-6CE00730E87C}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.TenantManagement.HttpApi.Host", "microservices\KonSoft.TenantManagement.HttpApi.Host\KonSoft.TenantManagement.HttpApi.Host.csproj", "{3641CA05-99C5-2245-C663-6CE00730E87C}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Localization", "shared\KonSoft.Shared.Localization\KonSoft.Shared.Localization.csproj", "{A773C53C-F145-043A-7F55-79ABDB11893B}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting", "shared\KonSoft.Shared.Hosting\KonSoft.Shared.Hosting.csproj", "{2DBCE12E-4A5F-4AB9-82BB-4BDDE48AABBF}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting.AspNetCore", "shared\KonSoft.Shared.Hosting.AspNetCore\KonSoft.Shared.Hosting.AspNetCore.csproj", "{8CA6B487-3AAF-4E77-ACE0-01D878DE4836}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting.Gateways", "shared\KonSoft.Shared.Hosting.Gateways\KonSoft.Shared.Hosting.Gateways.csproj", "{BBB1A129-9ED7-4F08-B710-B6C287197BFB}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting.Microservices", "shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj", "{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -211,6 +203,10 @@ Global
|
|||||||
{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -479,26 +475,6 @@ Global
|
|||||||
{3641CA05-99C5-2245-C663-6CE00730E87C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{3641CA05-99C5-2245-C663-6CE00730E87C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3641CA05-99C5-2245-C663-6CE00730E87C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{3641CA05-99C5-2245-C663-6CE00730E87C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{3641CA05-99C5-2245-C663-6CE00730E87C}.Release|Any CPU.Build.0 = Release|Any CPU
|
{3641CA05-99C5-2245-C663-6CE00730E87C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{A773C53C-F145-043A-7F55-79ABDB11893B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A773C53C-F145-043A-7F55-79ABDB11893B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A773C53C-F145-043A-7F55-79ABDB11893B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A773C53C-F145-043A-7F55-79ABDB11893B}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{2DBCE12E-4A5F-4AB9-82BB-4BDDE48AABBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{2DBCE12E-4A5F-4AB9-82BB-4BDDE48AABBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{2DBCE12E-4A5F-4AB9-82BB-4BDDE48AABBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{2DBCE12E-4A5F-4AB9-82BB-4BDDE48AABBF}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8CA6B487-3AAF-4E77-ACE0-01D878DE4836}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8CA6B487-3AAF-4E77-ACE0-01D878DE4836}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8CA6B487-3AAF-4E77-ACE0-01D878DE4836}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8CA6B487-3AAF-4E77-ACE0-01D878DE4836}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{BBB1A129-9ED7-4F08-B710-B6C287197BFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{BBB1A129-9ED7-4F08-B710-B6C287197BFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{BBB1A129-9ED7-4F08-B710-B6C287197BFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{BBB1A129-9ED7-4F08-B710-B6C287197BFB}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -522,6 +498,7 @@ Global
|
|||||||
{6C762F40-30BB-4CDA-951B-01D45F7C2B53} = {AAF02051-771B-4CC0-BD17-1A3643F83E09}
|
{6C762F40-30BB-4CDA-951B-01D45F7C2B53} = {AAF02051-771B-4CC0-BD17-1A3643F83E09}
|
||||||
{E67FA5C3-132C-4F47-B6A6-8FA4376C70BB} = {CF59695F-7948-4743-A467-42E4B4C9EECA}
|
{E67FA5C3-132C-4F47-B6A6-8FA4376C70BB} = {CF59695F-7948-4743-A467-42E4B4C9EECA}
|
||||||
{1C06151A-45F0-4D48-8303-3D4CBE9517F7} = {CF59695F-7948-4743-A467-42E4B4C9EECA}
|
{1C06151A-45F0-4D48-8303-3D4CBE9517F7} = {CF59695F-7948-4743-A467-42E4B4C9EECA}
|
||||||
|
{345B5CDA-DC77-4956-BF96-80707EC1B5B2} = {7EFFD2C6-2041-4967-A715-0F817D70C433}
|
||||||
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9} = {EBCB740D-07E7-4CED-A422-90EB824B9021}
|
{9D9D979A-AFC7-F9D0-2D23-8809E83F9EF9} = {EBCB740D-07E7-4CED-A422-90EB824B9021}
|
||||||
{9F68B0E2-0B1D-E0E8-1BE7-079F693A4643} = {EBCB740D-07E7-4CED-A422-90EB824B9021}
|
{9F68B0E2-0B1D-E0E8-1BE7-079F693A4643} = {EBCB740D-07E7-4CED-A422-90EB824B9021}
|
||||||
{D1A86C77-533D-5B68-04F1-7F7BFBF56AC7} = {EBCB740D-07E7-4CED-A422-90EB824B9021}
|
{D1A86C77-533D-5B68-04F1-7F7BFBF56AC7} = {EBCB740D-07E7-4CED-A422-90EB824B9021}
|
||||||
@ -589,11 +566,6 @@ Global
|
|||||||
{9A034977-0FBC-A3C8-8432-9FDD073F215A} = {4CBFE8AF-968B-453D-B763-3D0437C0883D}
|
{9A034977-0FBC-A3C8-8432-9FDD073F215A} = {4CBFE8AF-968B-453D-B763-3D0437C0883D}
|
||||||
{1C89424B-DA16-8840-4AB0-C446CFBD634C} = {4CBFE8AF-968B-453D-B763-3D0437C0883D}
|
{1C89424B-DA16-8840-4AB0-C446CFBD634C} = {4CBFE8AF-968B-453D-B763-3D0437C0883D}
|
||||||
{3641CA05-99C5-2245-C663-6CE00730E87C} = {4CBFE8AF-968B-453D-B763-3D0437C0883D}
|
{3641CA05-99C5-2245-C663-6CE00730E87C} = {4CBFE8AF-968B-453D-B763-3D0437C0883D}
|
||||||
{A773C53C-F145-043A-7F55-79ABDB11893B} = {7EFFD2C6-2041-4967-A715-0F817D70C433}
|
|
||||||
{2DBCE12E-4A5F-4AB9-82BB-4BDDE48AABBF} = {7EFFD2C6-2041-4967-A715-0F817D70C433}
|
|
||||||
{8CA6B487-3AAF-4E77-ACE0-01D878DE4836} = {7EFFD2C6-2041-4967-A715-0F817D70C433}
|
|
||||||
{BBB1A129-9ED7-4F08-B710-B6C287197BFB} = {7EFFD2C6-2041-4967-A715-0F817D70C433}
|
|
||||||
{ADF28580-F8A0-4495-96D6-736C6C7CF3FF} = {7EFFD2C6-2041-4967-A715-0F817D70C433}
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
|
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
|
||||||
|
|||||||
@ -69,8 +69,4 @@
|
|||||||
<PackageReference Include="Volo.Abp.OpenIddict.EntityFrameworkCore" Version="8.3.4" />
|
<PackageReference Include="Volo.Abp.OpenIddict.EntityFrameworkCore" Version="8.3.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,31 +1,48 @@
|
|||||||
using KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
using KonSoft.Shared.Hosting.Microservices;
|
|
||||||
using KonSoft.Shared.Localization.Localization;
|
|
||||||
using Localization.Resources.AbpUi;
|
using Localization.Resources.AbpUi;
|
||||||
|
using Medallion.Threading;
|
||||||
|
using Medallion.Threading.Redis;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using StackExchange.Redis;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
using Volo.Abp.Account;
|
using Volo.Abp.Account;
|
||||||
using Volo.Abp.Account.Localization;
|
using Volo.Abp.Account.Localization;
|
||||||
using Volo.Abp.Account.Web;
|
using Volo.Abp.Account.Web;
|
||||||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
|
||||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
|
||||||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
|
||||||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
|
||||||
|
using Volo.Abp.AspNetCore.Serilog;
|
||||||
using Volo.Abp.Auditing;
|
using Volo.Abp.Auditing;
|
||||||
|
using Volo.Abp.Autofac;
|
||||||
using Volo.Abp.BackgroundJobs;
|
using Volo.Abp.BackgroundJobs;
|
||||||
|
using Volo.Abp.Caching;
|
||||||
|
using Volo.Abp.Caching.StackExchangeRedis;
|
||||||
|
using Volo.Abp.DistributedLocking;
|
||||||
using Volo.Abp.Localization;
|
using Volo.Abp.Localization;
|
||||||
using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity;
|
||||||
using Volo.Abp.OpenIddict;
|
using Volo.Abp.OpenIddict;
|
||||||
using Volo.Abp.Security.Claims;
|
using Volo.Abp.Security.Claims;
|
||||||
|
using Volo.Abp.UI.Navigation.Urls;
|
||||||
|
using Volo.Abp.VirtualFileSystem;
|
||||||
|
|
||||||
namespace KonSoft;
|
namespace KonSoft;
|
||||||
|
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
|
typeof(AbpAutofacModule),
|
||||||
|
typeof(AbpCachingStackExchangeRedisModule),
|
||||||
|
typeof(AbpDistributedLockingModule),
|
||||||
typeof(AbpAccountWebOpenIddictModule),
|
typeof(AbpAccountWebOpenIddictModule),
|
||||||
typeof(AbpAccountApplicationModule),
|
typeof(AbpAccountApplicationModule),
|
||||||
typeof(AbpAccountHttpApiModule),
|
typeof(AbpAccountHttpApiModule),
|
||||||
typeof(KonSoftSharedHostingMicroservicesModule)
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
|
||||||
|
typeof(AbpAspNetCoreSerilogModule)
|
||||||
)]
|
)]
|
||||||
public class KonSoftAuthServerModule : AbpModule
|
public class KonSoftAuthServerModule : AbpModule
|
||||||
{
|
{
|
||||||
@ -90,11 +107,54 @@ public class KonSoftAuthServerModule : AbpModule
|
|||||||
options.ApplicationName = "AuthServer";
|
options.ApplicationName = "AuthServer";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Configure<AppUrlOptions>(options =>
|
||||||
|
{
|
||||||
|
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
|
||||||
|
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? []);
|
||||||
|
});
|
||||||
|
|
||||||
Configure<AbpBackgroundJobOptions>(options =>
|
Configure<AbpBackgroundJobOptions>(options =>
|
||||||
{
|
{
|
||||||
options.IsJobExecutionEnabled = false;
|
options.IsJobExecutionEnabled = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Configure<AbpDistributedCacheOptions>(options =>
|
||||||
|
{
|
||||||
|
options.KeyPrefix = "KonSoft:";
|
||||||
|
});
|
||||||
|
|
||||||
|
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("KonSoft");
|
||||||
|
if (!hostingEnvironment.IsDevelopment())
|
||||||
|
{
|
||||||
|
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
|
||||||
|
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "KonSoft-Protection-Keys");
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
|
||||||
|
{
|
||||||
|
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
|
||||||
|
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
|
||||||
|
});
|
||||||
|
|
||||||
|
context.Services.AddCors(options =>
|
||||||
|
{
|
||||||
|
options.AddDefaultPolicy(builder =>
|
||||||
|
{
|
||||||
|
builder
|
||||||
|
.WithOrigins(
|
||||||
|
configuration["App:CorsOrigins"]?
|
||||||
|
.Split(",", StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
.Select(o => o.RemovePostFix("/"))
|
||||||
|
.ToArray() ?? []
|
||||||
|
)
|
||||||
|
.WithAbpExposedHeaders()
|
||||||
|
.SetIsOriginAllowedToAllowWildcardSubdomains()
|
||||||
|
.AllowAnyHeader()
|
||||||
|
.AllowAnyMethod()
|
||||||
|
.AllowCredentials();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
|
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
|
||||||
{
|
{
|
||||||
options.IsDynamicClaimsEnabled = true;
|
options.IsDynamicClaimsEnabled = true;
|
||||||
@ -125,7 +185,7 @@ public class KonSoftAuthServerModule : AbpModule
|
|||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAbpOpenIddictValidation();
|
app.UseAbpOpenIddictValidation();
|
||||||
|
|
||||||
if (KonSoftConsts.MultiTenancyEnabled)
|
if (MultiTenancyConsts.IsEnabled)
|
||||||
{
|
{
|
||||||
app.UseMultiTenancy();
|
app.UseMultiTenancy();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using KonSoft.Shared.Localization.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Localization;
|
using KonSoft.Localization;
|
||||||
using Volo.Abp.DependencyInjection;
|
|
||||||
using Volo.Abp.Ui.Branding;
|
using Volo.Abp.Ui.Branding;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace KonSoft;
|
namespace KonSoft;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
@using Microsoft.AspNetCore.Http.Extensions
|
@using Microsoft.AspNetCore.Http.Extensions
|
||||||
@using Microsoft.AspNetCore.Mvc.Localization
|
@using Microsoft.AspNetCore.Mvc.Localization
|
||||||
@using KonSoft.Pages
|
@using KonSoft.Pages
|
||||||
@using KonSoft.Shared.Localization.Localization
|
@using KonSoft.Localization
|
||||||
@using Volo.Abp.Users
|
@using Volo.Abp.Users
|
||||||
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
|
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
|
||||||
@using Volo.Abp.Ui.Branding
|
@using Volo.Abp.Ui.Branding
|
||||||
|
|||||||
@ -1,37 +1,179 @@
|
|||||||
using KonSoft.Admin.EntityFrameworkCore;
|
using System;
|
||||||
using KonSoft.Shared.Hosting.AspNetCore;
|
using System.Collections.Generic;
|
||||||
using KonSoft.Shared.Hosting.Microservices;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Medallion.Threading;
|
||||||
|
using Medallion.Threading.Redis;
|
||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using KonSoft.Admin.EntityFrameworkCore;
|
||||||
|
using KonSoft.Admin.MultiTenancy;
|
||||||
|
using StackExchange.Redis;
|
||||||
|
using Microsoft.OpenApi.Models;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
using Volo.Abp.BackgroundJobs;
|
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Volo.Abp.AspNetCore.Mvc;
|
||||||
|
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
|
||||||
|
using Volo.Abp.AspNetCore.Serilog;
|
||||||
|
using Volo.Abp.Autofac;
|
||||||
|
using Volo.Abp.Caching;
|
||||||
|
using Volo.Abp.Caching.StackExchangeRedis;
|
||||||
|
using Volo.Abp.DistributedLocking;
|
||||||
|
using Volo.Abp.Identity;
|
||||||
|
using Volo.Abp.Localization;
|
||||||
using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity;
|
||||||
|
using Volo.Abp.Security.Claims;
|
||||||
|
using Volo.Abp.Swashbuckle;
|
||||||
|
using Volo.Abp.VirtualFileSystem;
|
||||||
|
|
||||||
namespace KonSoft.Admin;
|
namespace KonSoft.Admin;
|
||||||
|
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(AdminHttpApiModule),
|
typeof(AdminHttpApiModule),
|
||||||
|
typeof(AbpAutofacModule),
|
||||||
|
typeof(AbpCachingStackExchangeRedisModule),
|
||||||
|
typeof(AbpDistributedLockingModule),
|
||||||
|
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
|
||||||
|
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
|
||||||
typeof(AdminApplicationModule),
|
typeof(AdminApplicationModule),
|
||||||
typeof(AdminEntityFrameworkCoreModule),
|
typeof(AdminEntityFrameworkCoreModule),
|
||||||
typeof(KonSoftSharedHostingMicroservicesModule)
|
typeof(AbpAspNetCoreSerilogModule),
|
||||||
|
typeof(AbpSwashbuckleModule)
|
||||||
)]
|
)]
|
||||||
public class AdminHttpApiHostModule : AbpModule
|
public class AdminHttpApiHostModule : AbpModule
|
||||||
{
|
{
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||||
{
|
{
|
||||||
var configuration = context.Services.GetConfiguration();
|
var configuration = context.Services.GetConfiguration();
|
||||||
|
var hostingEnvironment = context.Services.GetHostingEnvironment();
|
||||||
|
|
||||||
SwaggerConfigurationHelper.ConfigureWithOidc(
|
ConfigureConventionalControllers();
|
||||||
context: context,
|
ConfigureAuthentication(context, configuration);
|
||||||
authority: configuration["AuthServer:Authority"]!,
|
ConfigureCache(configuration);
|
||||||
scopes: ["AdministrationService"],
|
ConfigureVirtualFileSystem(context);
|
||||||
discoveryEndpoint: configuration["AuthServer:MetadataAddress"],
|
ConfigureDataProtection(context, configuration, hostingEnvironment);
|
||||||
apiTitle: "Administration Service API"
|
ConfigureDistributedLocking(context, configuration);
|
||||||
);
|
ConfigureCors(context, configuration);
|
||||||
|
ConfigureSwaggerServices(context, configuration);
|
||||||
|
}
|
||||||
|
|
||||||
// ֻ<><D6BB><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
private void ConfigureCache(IConfiguration configuration)
|
||||||
Configure<AbpBackgroundJobOptions>(options => options.IsJobExecutionEnabled = false);
|
{
|
||||||
|
Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "Admin:"; });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConfigureVirtualFileSystem(ServiceConfigurationContext context)
|
||||||
|
{
|
||||||
|
var hostingEnvironment = context.Services.GetHostingEnvironment();
|
||||||
|
|
||||||
|
if (hostingEnvironment.IsDevelopment())
|
||||||
|
{
|
||||||
|
Configure<AbpVirtualFileSystemOptions>(options =>
|
||||||
|
{
|
||||||
|
options.FileSets.ReplaceEmbeddedByPhysical<AdminDomainSharedModule>(
|
||||||
|
Path.Combine(hostingEnvironment.ContentRootPath,
|
||||||
|
$"..{Path.DirectorySeparatorChar}KonSoft.Admin.Domain.Shared"));
|
||||||
|
options.FileSets.ReplaceEmbeddedByPhysical<AdminDomainModule>(
|
||||||
|
Path.Combine(hostingEnvironment.ContentRootPath,
|
||||||
|
$"..{Path.DirectorySeparatorChar}KonSoft.Admin.Domain"));
|
||||||
|
options.FileSets.ReplaceEmbeddedByPhysical<AdminApplicationContractsModule>(
|
||||||
|
Path.Combine(hostingEnvironment.ContentRootPath,
|
||||||
|
$"..{Path.DirectorySeparatorChar}KonSoft.Admin.Application.Contracts"));
|
||||||
|
options.FileSets.ReplaceEmbeddedByPhysical<AdminApplicationModule>(
|
||||||
|
Path.Combine(hostingEnvironment.ContentRootPath,
|
||||||
|
$"..{Path.DirectorySeparatorChar}KonSoft.Admin.Application"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConfigureConventionalControllers()
|
||||||
|
{
|
||||||
|
Configure<AbpAspNetCoreMvcOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ConventionalControllers.Create(typeof(AdminApplicationModule).Assembly);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||||
|
.AddAbpJwtBearer(options =>
|
||||||
|
{
|
||||||
|
options.Authority = configuration["AuthServer:Authority"];
|
||||||
|
options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata");
|
||||||
|
options.Audience = "Admin";
|
||||||
|
});
|
||||||
|
|
||||||
|
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
|
||||||
|
{
|
||||||
|
options.IsDynamicClaimsEnabled = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
context.Services.AddAbpSwaggerGenWithOAuth(
|
||||||
|
configuration["AuthServer:Authority"]!,
|
||||||
|
new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{"Admin", "Admin API"}
|
||||||
|
},
|
||||||
|
options =>
|
||||||
|
{
|
||||||
|
options.SwaggerDoc("v1", new OpenApiInfo { Title = "Admin API", Version = "v1" });
|
||||||
|
options.DocInclusionPredicate((docName, description) => true);
|
||||||
|
options.CustomSchemaIds(type => type.FullName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConfigureDataProtection(
|
||||||
|
ServiceConfigurationContext context,
|
||||||
|
IConfiguration configuration,
|
||||||
|
IWebHostEnvironment hostingEnvironment)
|
||||||
|
{
|
||||||
|
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("Admin");
|
||||||
|
if (!hostingEnvironment.IsDevelopment())
|
||||||
|
{
|
||||||
|
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
|
||||||
|
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "Admin-Protection-Keys");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConfigureDistributedLocking(
|
||||||
|
ServiceConfigurationContext context,
|
||||||
|
IConfiguration configuration)
|
||||||
|
{
|
||||||
|
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
|
||||||
|
{
|
||||||
|
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
|
||||||
|
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
context.Services.AddCors(options =>
|
||||||
|
{
|
||||||
|
options.AddDefaultPolicy(builder =>
|
||||||
|
{
|
||||||
|
builder
|
||||||
|
.WithOrigins(configuration["App:CorsOrigins"]?
|
||||||
|
.Split(",", StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
.Select(o => o.RemovePostFix("/"))
|
||||||
|
.ToArray() ?? [])
|
||||||
|
.WithAbpExposedHeaders()
|
||||||
|
.SetIsOriginAllowedToAllowWildcardSubdomains()
|
||||||
|
.AllowAnyHeader()
|
||||||
|
.AllowAnyMethod()
|
||||||
|
.AllowCredentials();
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
||||||
@ -51,7 +193,7 @@ public class AdminHttpApiHostModule : AbpModule
|
|||||||
app.UseCors();
|
app.UseCors();
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
|
||||||
if (KonSoftConsts.MultiTenancyEnabled)
|
if (MultiTenancyConsts.IsEnabled)
|
||||||
{
|
{
|
||||||
app.UseMultiTenancy();
|
app.UseMultiTenancy();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,22 @@
|
|||||||
<DockerfileContext>..\..</DockerfileContext>
|
<DockerfileContext>..\..</DockerfileContext>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
||||||
|
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.4" />
|
||||||
|
<PackageReference Include="DistributedLock.Redis" Version="1.0.2" />
|
||||||
|
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="8.3.4" />
|
||||||
|
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="8.3.4" />
|
||||||
|
<PackageReference Include="Volo.Abp.Autofac" Version="8.3.4" />
|
||||||
|
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="8.3.4" />
|
||||||
|
<PackageReference Include="Volo.Abp.DistributedLocking" Version="8.3.4" />
|
||||||
|
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="8.3.4" />
|
||||||
|
<PackageReference Include="Volo.Abp.Swashbuckle" Version="8.3.4" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Logs\**" />
|
<Compile Remove="Logs\**" />
|
||||||
<Content Remove="Logs\**" />
|
<Content Remove="Logs\**" />
|
||||||
@ -21,7 +37,6 @@
|
|||||||
<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.Application\KonSoft.Admin.Application.csproj" />
|
<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.Application\KonSoft.Admin.Application.csproj" />
|
||||||
<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.EntityFrameworkCore\KonSoft.Admin.EntityFrameworkCore.csproj" />
|
<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.EntityFrameworkCore\KonSoft.Admin.EntityFrameworkCore.csproj" />
|
||||||
<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.HttpApi\KonSoft.Admin.HttpApi.csproj" />
|
<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.HttpApi\KonSoft.Admin.HttpApi.csproj" />
|
||||||
<ProjectReference Include="..\..\shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,56 @@
|
|||||||
using KonSoft.Admin;
|
using System;
|
||||||
using KonSoft.Shared.Hosting.AspNetCore;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System;
|
using Serilog.Events;
|
||||||
|
|
||||||
var assemblyName = typeof(Program).Assembly.GetName().Name!;
|
namespace KonSoft.Admin;
|
||||||
|
|
||||||
SerilogConfigurationHelper.Configure(assemblyName);
|
public class Program
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Log.Information($"Starting {assemblyName}.");
|
public async static Task<int> Main(string[] args)
|
||||||
var app = await ApplicationBuilderHelper
|
{
|
||||||
.BuildApplicationAsync<AdminHttpApiHostModule>(args);
|
Log.Logger = new LoggerConfiguration()
|
||||||
|
#if DEBUG
|
||||||
|
.MinimumLevel.Debug()
|
||||||
|
#else
|
||||||
|
.MinimumLevel.Information()
|
||||||
|
#endif
|
||||||
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
||||||
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
|
||||||
|
.Enrich.FromLogContext()
|
||||||
|
.WriteTo.Async(c => c.File("Logs/logs.txt"))
|
||||||
|
.WriteTo.Async(c => c.Console())
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.Information("Starting KonSoft.Admin.HttpApi.Host.");
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.AddAppSettingsSecretsJson()
|
||||||
|
.UseAutofac()
|
||||||
|
.UseSerilog();
|
||||||
|
await builder.AddApplicationAsync<AdminHttpApiHostModule>();
|
||||||
|
var app = builder.Build();
|
||||||
await app.InitializeApplicationAsync();
|
await app.InitializeApplicationAsync();
|
||||||
await app.RunAsync();
|
await app.RunAsync();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
|
if (ex is HostAbortedException)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.Fatal(ex, "Host terminated unexpectedly!");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
await Log.CloseAndFlushAsync();
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,5 +1,12 @@
|
|||||||
{
|
{
|
||||||
"profiles": {
|
"profiles": {
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
"KonSoft.Admin.HttpApi.Host": {
|
"KonSoft.Admin.HttpApi.Host": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
@ -19,5 +26,13 @@
|
|||||||
"publishAllPorts": true,
|
"publishAllPorts": true,
|
||||||
"useSSL": true
|
"useSSL": true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "https://localhost:44354",
|
||||||
|
"sslPort": 44354
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"App": {
|
"App": {
|
||||||
"CorsOrigins": "https://*.KonSoft.top"
|
"CorsOrigins": "https://*.Admin.com,https://localhost:44357"
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"Default": "Host=1.94.99.47;Port=26666;Database=Clean;User ID=postgres;Password=zzx7845zzx;"
|
"Default": "Host=localhost;Port=5432;Database=Admin;User ID=root;Password=myPassword;"
|
||||||
},
|
},
|
||||||
"Redis": {
|
"Redis": {
|
||||||
"Configuration": "1.94.99.47:26668"
|
"Configuration": "127.0.0.1"
|
||||||
},
|
},
|
||||||
"AuthServer": {
|
"AuthServer": {
|
||||||
"Authority": "https://localhost:44397",
|
"Authority": "https://localhost:44397",
|
||||||
@ -15,15 +15,5 @@
|
|||||||
},
|
},
|
||||||
"StringEncryption": {
|
"StringEncryption": {
|
||||||
"DefaultPassPhrase": "g3NdNOyDR9oYj0gK"
|
"DefaultPassPhrase": "g3NdNOyDR9oYj0gK"
|
||||||
},
|
|
||||||
"RabbitMQ": {
|
|
||||||
"Connections": {
|
|
||||||
"Default": {
|
|
||||||
"HostName": "1.94.99.47",
|
|
||||||
"Port": 26667,
|
|
||||||
"UserName": "admin",
|
|
||||||
"Password": "zzx7845zzx"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
namespace KonSoft.Admin.MultiTenancy;
|
||||||
|
|
||||||
|
public static class MultiTenancyConsts
|
||||||
|
{
|
||||||
|
/* Enable/disable multi-tenancy easily in a single point.
|
||||||
|
* If you will never need to multi-tenancy, you can remove
|
||||||
|
* related modules and code parts, including this file.
|
||||||
|
*/
|
||||||
|
public const bool IsEnabled = true;
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using KonSoft.Admin.MultiTenancy;
|
||||||
using Volo.Abp.AuditLogging;
|
using Volo.Abp.AuditLogging;
|
||||||
using Volo.Abp.BackgroundJobs;
|
using Volo.Abp.BackgroundJobs;
|
||||||
using Volo.Abp.Emailing;
|
using Volo.Abp.Emailing;
|
||||||
@ -55,6 +56,10 @@ public class AdminDomainModule : AbpModule
|
|||||||
options.Languages.Add(new LanguageInfo("es", "es", "Español"));
|
options.Languages.Add(new LanguageInfo("es", "es", "Español"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Configure<AbpMultiTenancyOptions>(options =>
|
||||||
|
{
|
||||||
|
options.IsEnabled = MultiTenancyConsts.IsEnabled;
|
||||||
|
});
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
|
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Swashbuckle.AspNetCore.SwaggerUI;
|
|
||||||
using Volo.Abp.Swashbuckle;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
|
|
||||||
public static class AbpSwaggerUIBuilderExtensions
|
|
||||||
{
|
|
||||||
public static IApplicationBuilder UseAbpSwaggerWithCustomScriptUI(
|
|
||||||
this IApplicationBuilder app,
|
|
||||||
Action<SwaggerUIOptions>? setupAction = null)
|
|
||||||
{
|
|
||||||
var resolver = app.ApplicationServices.GetService<ISwaggerHtmlResolver>();
|
|
||||||
|
|
||||||
return app.UseSwaggerUI(options =>
|
|
||||||
{
|
|
||||||
options.InjectJavascript("ui/abp.js");
|
|
||||||
options.InjectJavascript("ui/abp.swagger.js");
|
|
||||||
options.InjectJavascript("ui/requestinterceptor.js");
|
|
||||||
options.IndexStream = () => resolver?.Resolver();
|
|
||||||
|
|
||||||
setupAction?.Invoke(options);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Serilog;
|
|
||||||
using Volo.Abp.Modularity;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
|
|
||||||
public static class ApplicationBuilderHelper
|
|
||||||
{
|
|
||||||
public static async Task<WebApplication> BuildApplicationAsync<TStartupModule>(string[] args)
|
|
||||||
where TStartupModule : IAbpModule
|
|
||||||
{
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
|
||||||
builder.Host
|
|
||||||
.AddAppSettingsSecretsJson()
|
|
||||||
.UseAutofac()
|
|
||||||
.UseSerilog();
|
|
||||||
|
|
||||||
await builder.AddApplicationAsync<TStartupModule>();
|
|
||||||
return builder.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<RootNamespace>KonSoft.Shared.Hosting.AspNetCore</RootNamespace>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\KonSoft.Shared.Hosting\KonSoft.Shared.Hosting.csproj" />
|
|
||||||
<ProjectReference Include="..\KonSoft.Shared.Localization\KonSoft.Shared.Localization.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
|
||||||
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.Swashbuckle" Version="8.3.4" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="wwwroot\swagger\ui\requestinterceptor.js" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="wwwroot\swagger\ui\requestinterceptor.js">
|
|
||||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="wwwroot\swagger\ui\requestinterceptor.js" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
using Volo.Abp.DependencyInjection;
|
|
||||||
using Volo.Abp.Ui.Branding;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.AspNetCore
|
|
||||||
{
|
|
||||||
[Dependency(ReplaceServices = true)]
|
|
||||||
public class KonSoftBrandingProvider : DefaultBrandingProvider
|
|
||||||
{
|
|
||||||
public override string AppName => "KonSoft";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
namespace KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
|
|
||||||
public static class KonSoftConsts
|
|
||||||
{
|
|
||||||
public const string AuthServerAudience = "KonSoft";
|
|
||||||
public const string AnonymousUserClaimName = "anonymous_id";
|
|
||||||
public const bool MultiTenancyEnabled = true;
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
using KonSoft.Shared.Localization;
|
|
||||||
using Volo.Abp.AspNetCore.Serilog;
|
|
||||||
using Volo.Abp.Modularity;
|
|
||||||
using Volo.Abp.MultiTenancy;
|
|
||||||
using Volo.Abp.Swashbuckle;
|
|
||||||
using Volo.Abp.VirtualFileSystem;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.AspNetCore
|
|
||||||
{
|
|
||||||
[DependsOn(
|
|
||||||
typeof(KonSoftSharedLocalizationModule),
|
|
||||||
typeof(KonSoftSharedHostingModule),
|
|
||||||
typeof(AbpAspNetCoreSerilogModule),
|
|
||||||
typeof(AbpSwashbuckleModule),
|
|
||||||
typeof(AbpMultiTenancyModule)
|
|
||||||
)]
|
|
||||||
public class KonSoftSharedHostingAspNetCoreModule : AbpModule
|
|
||||||
{
|
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
||||||
{
|
|
||||||
Configure<AbpVirtualFileSystemOptions>(options =>
|
|
||||||
{
|
|
||||||
options.FileSets.AddEmbedded<KonSoftSharedHostingAspNetCoreModule>("KonSoft.Shared.Hosting.AspNetCore");
|
|
||||||
});
|
|
||||||
|
|
||||||
Configure<AbpMultiTenancyOptions>(options =>
|
|
||||||
{
|
|
||||||
options.IsEnabled = KonSoftConsts.MultiTenancyEnabled;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
using Serilog;
|
|
||||||
using Serilog.Events;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
|
|
||||||
public static class SerilogConfigurationHelper
|
|
||||||
{
|
|
||||||
public static void Configure(string applicationName)
|
|
||||||
{
|
|
||||||
Log.Logger = new LoggerConfiguration()
|
|
||||||
#if DEBUG
|
|
||||||
.MinimumLevel.Debug()
|
|
||||||
#else
|
|
||||||
.MinimumLevel.Information()
|
|
||||||
#endif
|
|
||||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
|
||||||
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
|
|
||||||
.Enrich.FromLogContext()
|
|
||||||
.Enrich.WithProperty("Application", $"{applicationName}")
|
|
||||||
.WriteTo.Async(c => c.File("Logs/logs.txt"))
|
|
||||||
.WriteTo.Async(c => c.Console())
|
|
||||||
.CreateLogger();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.OpenApi.Models;
|
|
||||||
using Volo.Abp.Modularity;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
|
|
||||||
public static class SwaggerConfigurationHelper
|
|
||||||
{
|
|
||||||
public static void ConfigureWithOidc(
|
|
||||||
ServiceConfigurationContext context,
|
|
||||||
string authority,
|
|
||||||
string[] scopes,
|
|
||||||
string apiTitle,
|
|
||||||
string apiVersion = "v1",
|
|
||||||
string apiName = "v1",
|
|
||||||
string[]? flows = null,
|
|
||||||
string? discoveryEndpoint = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
context.Services.AddAbpSwaggerGenWithOidc(
|
|
||||||
authority: authority,
|
|
||||||
scopes: scopes,
|
|
||||||
flows: flows,
|
|
||||||
discoveryEndpoint: discoveryEndpoint,
|
|
||||||
options =>
|
|
||||||
{
|
|
||||||
options.SwaggerDoc(apiName, new OpenApiInfo { Title = apiTitle, Version = apiVersion });
|
|
||||||
options.DocInclusionPredicate((docName, description) => true);
|
|
||||||
options.CustomSchemaIds(type => type.FullName);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
const originalFetch = window.fetch;
|
|
||||||
|
|
||||||
window.fetch = function (input, init) {
|
|
||||||
if (init !== undefined && init.headers['RequestVerificationToken'] !== undefined) {
|
|
||||||
delete init.headers['RequestVerificationToken'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return originalFetch.apply(this, arguments);
|
|
||||||
};
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
namespace KonSoft.Shared.Hosting.Gateways
|
|
||||||
{
|
|
||||||
public class Class1
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<RootNamespace>KonSoft.Shared.Hosting.Microservices</RootNamespace>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\KonSoft.Shared.Hosting.AspNetCore\KonSoft.Shared.Hosting.AspNetCore.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.20" />
|
|
||||||
<PackageReference Include="DistributedLock.Redis" Version="1.1.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.BackgroundJobs.RabbitMQ" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.DistributedLocking" Version="8.3.4" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
using KonSoft.Shared.Hosting.AspNetCore;
|
|
||||||
using Medallion.Threading;
|
|
||||||
using Medallion.Threading.Redis;
|
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using StackExchange.Redis;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.AspNetCore.Cors;
|
|
||||||
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
|
|
||||||
using Volo.Abp.BackgroundJobs.RabbitMQ;
|
|
||||||
using Volo.Abp.Caching;
|
|
||||||
using Volo.Abp.Caching.StackExchangeRedis;
|
|
||||||
using Volo.Abp.DistributedLocking;
|
|
||||||
using Volo.Abp.EntityFrameworkCore;
|
|
||||||
using Volo.Abp.EventBus.RabbitMq;
|
|
||||||
using Volo.Abp.Modularity;
|
|
||||||
using Volo.Abp.Security.Claims;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.Microservices
|
|
||||||
{
|
|
||||||
[DependsOn(
|
|
||||||
typeof(KonSoftSharedHostingAspNetCoreModule),
|
|
||||||
typeof(AbpBackgroundJobsRabbitMqModule),
|
|
||||||
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
|
|
||||||
typeof(AbpEventBusRabbitMqModule),
|
|
||||||
typeof(AbpCachingStackExchangeRedisModule),
|
|
||||||
typeof(AbpDistributedLockingModule),
|
|
||||||
typeof(AbpEntityFrameworkCoreModule)
|
|
||||||
)]
|
|
||||||
public class KonSoftSharedHostingMicroservicesModule : AbpModule
|
|
||||||
{
|
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
||||||
{
|
|
||||||
var configuration = context.Services.GetConfiguration();
|
|
||||||
var hostingEnvironment = context.Services.GetHostingEnvironment();
|
|
||||||
|
|
||||||
ConfigureCache();
|
|
||||||
ConfigureDataProtection(context, configuration);
|
|
||||||
ConfigureAuthentication(context, configuration);
|
|
||||||
ConfigureCors(context, configuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ConfigureCache()
|
|
||||||
{
|
|
||||||
Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "KonSoft:"; });
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ConfigureDataProtection(
|
|
||||||
ServiceConfigurationContext context,
|
|
||||||
IConfiguration configuration)
|
|
||||||
{
|
|
||||||
context.Services.AddDataProtection().SetApplicationName("KonSoft")
|
|
||||||
.PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!),
|
|
||||||
"KonSoft-Protection-Keys");
|
|
||||||
|
|
||||||
context.Services.AddSingleton<IDistributedLockProvider>(_ =>
|
|
||||||
new RedisDistributedSynchronizationProvider(ConnectionMultiplexer
|
|
||||||
.Connect(configuration["Redis:Configuration"]!).GetDatabase()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
|
|
||||||
{
|
|
||||||
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
|
||||||
.AddAbpJwtBearer(options =>
|
|
||||||
{
|
|
||||||
options.Authority = configuration["AuthServer:Authority"];
|
|
||||||
options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata");
|
|
||||||
options.Audience = KonSoftConsts.AuthServerAudience;
|
|
||||||
});
|
|
||||||
|
|
||||||
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
|
|
||||||
{
|
|
||||||
options.IsDynamicClaimsEnabled = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration)
|
|
||||||
{
|
|
||||||
context.Services.AddCors(options =>
|
|
||||||
{
|
|
||||||
options.AddDefaultPolicy(builder =>
|
|
||||||
{
|
|
||||||
builder
|
|
||||||
.WithOrigins(configuration["App:CorsOrigins"]?
|
|
||||||
.Split(",", StringSplitOptions.RemoveEmptyEntries)
|
|
||||||
.Select(o => o.RemovePostFix("/"))
|
|
||||||
.ToArray() ?? [])
|
|
||||||
.WithAbpExposedHeaders()
|
|
||||||
.SetIsOriginAllowedToAllowWildcardSubdomains()
|
|
||||||
.AllowAnyHeader()
|
|
||||||
.AllowAnyMethod()
|
|
||||||
.AllowCredentials();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<RootNamespace>KonSoft.Shared.Hosting</RootNamespace>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
|
||||||
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
|
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Volo.Abp.Autofac" Version="8.3.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.Data" Version="8.3.4" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
using Volo.Abp.Autofac;
|
|
||||||
using Volo.Abp.Data;
|
|
||||||
using Volo.Abp.Modularity;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting
|
|
||||||
{
|
|
||||||
[DependsOn(
|
|
||||||
typeof(AbpAutofacModule),
|
|
||||||
typeof(AbpDataModule)
|
|
||||||
)]
|
|
||||||
public class KonSoftSharedHostingModule : AbpModule
|
|
||||||
{
|
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
||||||
{
|
|
||||||
Configure<AbpDbConnectionOptions>(options =>
|
|
||||||
{
|
|
||||||
// TODO Mapping DbConnections
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<RootNamespace>KonSoft.Shared.Localization</RootNamespace>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.4" />
|
|
||||||
<PackageReference Include="Volo.Abp.Validation" Version="8.3.4" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Localization\EShopOnAbp\*.json" />
|
|
||||||
<Content Remove="Localization\EShopOnAbp\*.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Localization\KonSoft\en.json" />
|
|
||||||
<EmbeddedResource Include="Localization\KonSoft\zh-Hans.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
using KonSoft.Shared.Localization.Localization;
|
|
||||||
using Volo.Abp.Localization;
|
|
||||||
using Volo.Abp.Modularity;
|
|
||||||
using Volo.Abp.Validation;
|
|
||||||
using Volo.Abp.Validation.Localization;
|
|
||||||
using Volo.Abp.VirtualFileSystem;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Localization
|
|
||||||
{
|
|
||||||
|
|
||||||
[DependsOn(
|
|
||||||
typeof(AbpValidationModule)
|
|
||||||
)]
|
|
||||||
public class KonSoftSharedLocalizationModule : AbpModule
|
|
||||||
{
|
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
||||||
{
|
|
||||||
Configure<AbpVirtualFileSystemOptions>(options =>
|
|
||||||
{
|
|
||||||
options.FileSets.AddEmbedded<KonSoftSharedLocalizationModule>();
|
|
||||||
});
|
|
||||||
|
|
||||||
Configure<AbpLocalizationOptions>(options =>
|
|
||||||
{
|
|
||||||
options.Resources
|
|
||||||
.Add<KonSoftResource>("en")
|
|
||||||
.AddBaseTypes(
|
|
||||||
typeof(AbpValidationResource)
|
|
||||||
).AddVirtualJson("/Localization/KonSoft");
|
|
||||||
|
|
||||||
options.DefaultResourceType = typeof(KonSoftResource);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"culture": "en",
|
|
||||||
"texts": {
|
|
||||||
"AppName": "Admin",
|
|
||||||
"Menu:Home": "Home",
|
|
||||||
"Welcome": "Welcome",
|
|
||||||
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"culture": "zh-Hans",
|
|
||||||
"texts": {
|
|
||||||
"AppName": "Admin",
|
|
||||||
"Menu:Home": "首页",
|
|
||||||
"Welcome": "欢迎",
|
|
||||||
"LongWelcomeMessage": "欢迎使用本应用程序。这是一个基于 ABP 框架的启动项目。更多信息,请访问 abp.io。"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
using Volo.Abp.Localization;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Localization.Localization
|
|
||||||
{
|
|
||||||
[LocalizationResourceName("KonSoft")]
|
|
||||||
public class KonSoftResource
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
7
shared/KonSoft.Shared/Class1.cs
Normal file
7
shared/KonSoft.Shared/Class1.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace KonSoft.Shared
|
||||||
|
{
|
||||||
|
public class Class1
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<RootNamespace>KonSoft.Shared.Hosting.Gateways</RootNamespace>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
Reference in New Issue
Block a user