mirror of https://github.com/abpframework/abp.git
committed by
GitHub
4 changed files with 51 additions and 30 deletions
@ -1,50 +1,33 @@ |
|||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Localization.Resources.AbpUi; |
|
||||
using Microsoft.AspNetCore.Components; |
using Microsoft.AspNetCore.Components; |
||||
using Microsoft.AspNetCore.Components.Routing; |
using Microsoft.AspNetCore.Components.Routing; |
||||
using Microsoft.Extensions.Localization; |
|
||||
using Microsoft.Extensions.Options; |
|
||||
using Volo.Abp.Http.Client; |
|
||||
using Volo.Abp.UI.Navigation; |
using Volo.Abp.UI.Navigation; |
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic |
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic |
||||
{ |
{ |
||||
public partial class LoginDisplay : IDisposable |
public partial class LoginDisplay : IDisposable |
||||
{ |
{ |
||||
[Inject] |
|
||||
protected IMenuManager MenuManager { get; set; } |
|
||||
|
|
||||
[Inject] |
|
||||
protected IStringLocalizer<AbpUiResource> UiLocalizer { get; set; } |
|
||||
|
|
||||
[Inject] |
[Inject] |
||||
protected IOptions<AbpRemoteServiceOptions> RemoteServiceOptions { get; set; } |
protected IMenuManager MenuManager { get; set; } |
||||
|
|
||||
protected ApplicationMenu Menu { get; set; } |
|
||||
|
|
||||
protected string ServerUrl { get; set; } |
protected ApplicationMenu Menu { get; set; } |
||||
protected string ServerAccountUrl { get; set; } |
|
||||
|
|
||||
protected override async Task OnInitializedAsync() |
protected override async Task OnInitializedAsync() |
||||
{ |
{ |
||||
Menu = await MenuManager.GetAsync(StandardMenus.User); |
Menu = await MenuManager.GetAsync(StandardMenus.User); |
||||
|
|
||||
ServerUrl = RemoteServiceOptions.Value.RemoteServices.Default?.BaseUrl?.TrimEnd('/'); |
|
||||
ServerAccountUrl = ServerUrl + "/Account/Manage?returnUrl=" + Navigation.Uri; |
|
||||
|
|
||||
Navigation.LocationChanged += OnLocationChanged; |
Navigation.LocationChanged += OnLocationChanged; |
||||
} |
} |
||||
|
|
||||
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e) |
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e) |
||||
{ |
{ |
||||
ServerAccountUrl = ServerUrl + "/Account/Manage?returnUrl=" + Navigation.Uri; |
|
||||
StateHasChanged(); |
StateHasChanged(); |
||||
} |
} |
||||
|
|
||||
public void Dispose() |
public void Dispose() |
||||
{ |
{ |
||||
Navigation.LocationChanged -= OnLocationChanged; |
Navigation.LocationChanged -= OnLocationChanged; |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue