diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyCompanyName.MyProjectName.Blazor.Host.csproj b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyCompanyName.MyProjectName.Blazor.Host.csproj
index 8c5f7d3dd5..a7e0123a16 100644
--- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyCompanyName.MyProjectName.Blazor.Host.csproj
+++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyCompanyName.MyProjectName.Blazor.Host.csproj
@@ -20,8 +20,10 @@
+
-
+
+
diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs
index 045dfa72c9..3ff7058579 100644
--- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs
+++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs
@@ -5,7 +5,7 @@ using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Volo.Abp.Account.Blazor;
+using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme;
@@ -13,6 +13,8 @@ using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.AutoMapper;
using Volo.Abp.Identity.Blazor.WebAssembly;
using Volo.Abp.Modularity;
+using Volo.Abp.SettingManagement.Blazor.WebAssembly;
+using Volo.Abp.TenantManagement.Blazor.WebAssembly;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor.Host
@@ -20,8 +22,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Host
[DependsOn(
typeof(AbpAutofacWebAssemblyModule),
typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule),
+ typeof(AbpAccountApplicationContractsModule),
typeof(AbpIdentityBlazorWebAssemblyModule),
- typeof(AbpAccountBlazorModule),
+ typeof(AbpTenantManagementBlazorWebAssemblyModule),
+ typeof(AbpSettingManagementBlazorWebAssemblyModule),
typeof(MyProjectNameBlazorModule)
)]
public class MyProjectNameBlazorHostModule : AbpModule
@@ -52,7 +56,7 @@ namespace MyCompanyName.MyProjectName.Blazor.Host
{
Configure(options =>
{
- options.MenuContributors.Add(new MyProjectNameHostMenuContributor());
+ options.MenuContributors.Add(new MyProjectNameHostMenuContributor(context.Services.GetConfiguration()));
});
}
diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameHostMenuContributor.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameHostMenuContributor.cs
index c7e04108b8..77a081bd74 100644
--- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameHostMenuContributor.cs
+++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameHostMenuContributor.cs
@@ -1,29 +1,41 @@
-using System.Threading.Tasks;
-using MyCompanyName.MyProjectName.Localization;
+using System;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Configuration;
+using Volo.Abp.Authorization.Permissions;
using Volo.Abp.UI.Navigation;
-
+using Volo.Abp.Account.Localization;
namespace MyCompanyName.MyProjectName.Blazor.Host
{
public class MyProjectNameHostMenuContributor : IMenuContributor
{
- public Task ConfigureMenuAsync(MenuConfigurationContext context)
+ private readonly IConfiguration _configuration;
+
+ public MyProjectNameHostMenuContributor(IConfiguration configuration)
+ {
+ _configuration = configuration;
+ }
+
+ public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
- if(context.Menu.DisplayName != StandardMenus.Main)
+ if (context.Menu.Name == StandardMenus.User)
{
- return Task.CompletedTask;
+ await ConfigureUserMenuAsync(context);
}
+ }
+
+ private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
+ {
+ var accountStringLocalizer = context.GetLocalizer();
- var l = context.GetLocalizer();
+ var identityServerUrl = _configuration["AuthServer:Authority"] ?? "";
- context.Menu.Items.Insert(
- 0,
- new ApplicationMenuItem(
- "MyProjectName.Home",
- l["Menu:Home"],
- "/",
- icon: "fas fa-home"
- )
- );
+ context.Menu.AddItem(new ApplicationMenuItem(
+ "Account.Manage",
+ accountStringLocalizer["ManageYourProfile"],
+ $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}",
+ icon: "fa fa-cog",
+ order: 1000,
+ null).RequireAuthenticated());
return Task.CompletedTask;
}
diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/appsettings.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/appsettings.json
index fdcb329db4..96ff7b45e9 100644
--- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/appsettings.json
+++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/appsettings.json
@@ -1,4 +1,7 @@
{
+ "App": {
+ "SelfUrl": "https://localhost:44307"
+ },
"AuthServer": {
"Authority": "https://localhost:44301",
"ClientId": "MyProjectName_Blazor",
@@ -6,7 +9,10 @@
},
"RemoteServices": {
"Default": {
- "BaseUrl": "https://localhost:44300"
- }
- }
+ "BaseUrl": "https://localhost:44301/"
+ },
+ "MyProjectName": {
+ "BaseUrl": "https://localhost:44300/"
+ }
+ }
}
diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
index 477501ee47..dfb3d07c39 100644
--- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
+++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
@@ -29,6 +29,8 @@
+
+
diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
index 25e9366802..4b03b11412 100644
--- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
+++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
@@ -39,6 +39,7 @@ using Volo.Abp.PermissionManagement;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.PermissionManagement.Identity;
+using Volo.Abp.SettingManagement;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.Swashbuckle;
using Volo.Abp.TenantManagement;
@@ -67,6 +68,8 @@ namespace MyCompanyName.MyProjectName
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
+ typeof(AbpSettingManagementApplicationModule),
+ typeof(AbpSettingManagementHttpApiModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementHttpApiModule),
@@ -105,7 +108,7 @@ namespace MyCompanyName.MyProjectName
options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština"));
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)"));
- options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish"));
+ options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish"));
options.Languages.Add(new LanguageInfo("fr", "fr", "Français"));
options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in"));
options.Languages.Add(new LanguageInfo("it", "it", "Italian", "it"));