mirror of https://github.com/abpframework/abp.git
committed by
GitHub
4 changed files with 0 additions and 46 deletions
@ -1,25 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Account.Web.Modules.Account.Components.Toolbar.UserLoginLink; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace Volo.Abp.Account.Web; |
|||
|
|||
public class AccountModuleToolbarContributor : IToolbarContributor |
|||
{ |
|||
public virtual Task ConfigureToolbarAsync(IToolbarConfigurationContext context) |
|||
{ |
|||
if (context.Toolbar.Name != StandardToolbars.Main) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
if (!context.ServiceProvider.GetRequiredService<ICurrentUser>().IsAuthenticated) |
|||
{ |
|||
context.Toolbar.Items.Add(new ToolbarItem(typeof(UserLoginLinkViewComponent))); |
|||
} |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
@ -1,4 +0,0 @@ |
|||
@using Localization.Resources.AbpUi |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@inject IHtmlLocalizer<AbpUiResource> L |
|||
<a class="nav-link" role="button" href="~/Account/Login">@L["Login"]</a> |
|||
@ -1,12 +0,0 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Abp.Account.Web.Modules.Account.Components.Toolbar.UserLoginLink; |
|||
|
|||
public class UserLoginLinkViewComponent : AbpViewComponent |
|||
{ |
|||
public virtual IViewComponentResult Invoke() |
|||
{ |
|||
return View("~/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml"); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue