From 1ddef32a83ad69e9f7e28f1c9d2550fb6097179d Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Tue, 4 Jan 2022 01:58:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20LogoutLink=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor | 2 +- .../admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs | 6 ------ .../client/BootstrapClient.Shared/Shared/MainLayout.razor | 4 ++-- .../BootstrapClient.Shared/Shared/MainLayout.razor.cs | 4 ++-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor b/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor index d1097616..0093ff47 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor @@ -11,7 +11,7 @@ 个人中心 设置 通知 - 注销 +
diff --git a/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs index cb3faf60..ffa8c29e 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs @@ -13,10 +13,6 @@ namespace BootstrapAdmin.Web.Shared { private IEnumerable? MenuItems { get; set; } - [Inject] - [NotNull] - private NavigationManager? NavigationManager { get; set; } - [Inject] [NotNull] private INavigation? NavigationsService { get; set; } @@ -77,8 +73,6 @@ namespace BootstrapAdmin.Web.Shared private Task OnAuthorizing(string url) => SecurityService.AuhorizingNavigation(Context.UserName, url); - private void OnLogout() => NavigationManager.NavigateTo("/Account/Logout", true); - private async Task OnErrorHandleAsync(ILogger logger, Exception ex) { await ToastService.Error(Title, ex.Message); diff --git a/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor b/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor index 1c841bb2..4f319a77 100644 --- a/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor +++ b/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor @@ -13,7 +13,7 @@ 个人中心 设置 通知 - 注销 +
@@ -44,7 +44,7 @@ - + diff --git a/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor.cs b/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor.cs index 71edb1cf..e73ace1b 100644 --- a/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor.cs +++ b/src/blazor/client/BootstrapClient.Shared/Shared/MainLayout.razor.cs @@ -128,8 +128,8 @@ namespace BootstrapClient.Web.Shared.Shared private Task OnAuthorizing(string url) => SecurityService.AuhorizingNavigation(UserName, url); - private string GetAuthorUrl() => CombinePath($"/Account/Login?ReturnUrl={NavigationManager.Uri}"); + private string LogoutUrl => CombinePath($"/Account/Logout"); - private void OnLogout() => NavigationManager.NavigateTo(CombinePath("/Account/Logout"), true); + private string AuthorUrl => CombinePath($"/Account/Login?ReturnUrl={NavigationManager.Uri}"); } }