route
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<div id="header-sticky" class="header-bottom__area header-mob-space header-bottom__area-2 header-bottom__transparent z-index-5">
|
||||
@inject Services.localService servlocal;
|
||||
<div id="header-sticky" class="header-bottom__area header-mob-space header-bottom__area-2 header-bottom__transparent z-index-5">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-xxl-1 col-xl-1 col-lg-1 col-md-3 col-5">
|
||||
@@ -36,7 +37,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-4 col-md-7 col-5">
|
||||
<LSign_in_Register />
|
||||
@if (servlocal.OnlineUser().Result)
|
||||
{
|
||||
<LinfoUser />
|
||||
}
|
||||
else
|
||||
{
|
||||
<LSign_in_Register />
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,4 +60,5 @@
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
}
|
||||
|
43
TaxPayerFull/Layout/LinfoUser.razor
Normal file
43
TaxPayerFull/Layout/LinfoUser.razor
Normal file
@@ -0,0 +1,43 @@
|
||||
@using Front.Services
|
||||
@using Shared.DTOs
|
||||
@inject ILocalStorageService Storage;
|
||||
@inject UserAuthenticationDTO userinfo
|
||||
@inject HttpClient _hc
|
||||
@inject NavigationManager nav
|
||||
<div class="header-bottom__right d-flex align-items-center justify-content-end">
|
||||
<div class="header-bottom">
|
||||
<NavLink style="cursor:pointer" onclick="@Logout">
|
||||
|
||||
<span style="color:red;">خروج</span>
|
||||
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="header-bottom__btn">
|
||||
<NavLink class="d-none d-lg-inline-block last-child" href="Panel">
|
||||
<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 8C8.92882 8 10.4924 6.433 10.4924 4.5C10.4924 2.567 8.92882 1 7 1C5.07118 1 3.50757 2.567 3.50757 4.5C3.50757 6.433 5.07118 8 7 8Z"
|
||||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
|
||||
stroke-linejoin="round" />
|
||||
<path d="M13 15C13 12.291 10.3108 10.1 7 10.1C3.68917 10.1 1 12.291 1 15"
|
||||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
|
||||
stroke-linejoin="round" />
|
||||
</svg>
|
||||
|
||||
<span>@userinfo.FullName</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@functions {
|
||||
private async Task Logout()
|
||||
{
|
||||
_hc.DefaultRequestHeaders.Clear();
|
||||
await Storage.RemoveItem("token");
|
||||
userinfo.Token = "";
|
||||
nav.Refresh();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user