From 1b25289fee715d0901aad5b92658797c05708522 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 25 Jan 2022 17:11:30 +0800 Subject: [PATCH] Blazor-server Support deploy sub application --- .../Themes/Basic/LanguageSwitch.razor | 8 ++++---- .../Themes/Basic/LoginDisplay.razor | 6 +++--- .../Themes/Basic/Branding.razor | 2 +- .../Pages/Index.razor | 4 ++-- .../Pages/_Host.cshtml | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor index 2a0ab7397a..75b64e05b7 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor @@ -30,7 +30,7 @@ CultureInfo.CurrentCulture.Name, CultureInfo.CurrentUICulture.Name ); - + if (currentLanguage == null) { var localizationOptions = await RequestLocalizationOptionsProvider.GetLocalizationOptionsAsync(); @@ -56,10 +56,10 @@ private void ChangeLanguage(LanguageInfo language) { - var relativeUrl = NavigationManager.Uri.RemovePreFix(NavigationManager.BaseUri).EnsureStartsWith('/'); - + var relativeUrl = NavigationManager.Uri.RemovePreFix(NavigationManager.BaseUri).EnsureStartsWith('/').EnsureStartsWith('~'); + NavigationManager.NavigateTo( - $"/Abp/Languages/Switch?culture={language.CultureName}&uiCulture={language.UiCultureName}&returnUrl={relativeUrl}", + $"Abp/Languages/Switch?culture={language.CultureName}&uiCulture={language.UiCultureName}&returnUrl={relativeUrl}", forceLoad: true ); } diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor index 07e4d9918d..adc42e8da3 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor @@ -26,13 +26,13 @@ { @foreach (var menuItem in Menu.Items) { - @menuItem.DisplayName + @menuItem.DisplayName } } - @L["Login"] + @L["Login"] - \ No newline at end of file + diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/Branding.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/Branding.razor index 5e0537b2b2..a0c91635a9 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/Branding.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/Branding.razor @@ -3,7 +3,7 @@ @if (!BrandingProvider.LogoUrl.IsNullOrWhiteSpace()) { - @BrandingProvider.AppName + @BrandingProvider.AppName } @BrandingProvider.AppName diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 93745851b5..4bb044a987 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -12,10 +12,10 @@

Welcome to the Application

@L["LongWelcomeMessage"]

- + @if (!CurrentUser.IsAuthenticated) { - @L["Login"] + @L["Login"] } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml index 0da32f7519..f72161d5d4 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml @@ -16,7 +16,7 @@ MyCompanyName.MyProjectName.Blazor.Server - +