Browse Source
Initialize the `AbpComponentsClaimsCache` on `AbpAspNetCoreComponentsWebAssemblyModule`.
pull/12947/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
2 changed files with
3 additions and
19 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs
-
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs
|
|
|
@ -1,11 +1,8 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Components; |
|
|
|
using Microsoft.AspNetCore.Components; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions; |
|
|
|
using Volo.Abp.AspNetCore.Components.DependencyInjection; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web.Security; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.UI; |
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Components.Web; |
|
|
|
@ -16,23 +13,8 @@ namespace Volo.Abp.AspNetCore.Components.Web; |
|
|
|
)] |
|
|
|
public class AbpAspNetCoreComponentsWebModule : AbpModule |
|
|
|
{ |
|
|
|
public override void PreConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>()); |
|
|
|
} |
|
|
|
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context)); |
|
|
|
} |
|
|
|
|
|
|
|
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
await context.ServiceProvider.GetRequiredService<AbpComponentsClaimsCache>().InitializeAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web.Security; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.Client; |
|
|
|
using Volo.Abp.Http.Client; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
@ -46,6 +47,7 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule |
|
|
|
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
await context.ServiceProvider.GetRequiredService<WebAssemblyCachedApplicationConfigurationClient>().InitializeAsync(); |
|
|
|
await context.ServiceProvider.GetRequiredService<AbpComponentsClaimsCache>().InitializeAsync(); |
|
|
|
await SetCurrentLanguageAsync(context.ServiceProvider); |
|
|
|
} |
|
|
|
|
|
|
|
|