Files
moadiran/TaxPayerFull/Layout/LinfoUser.razor

43 lines
1.5 KiB
Plaintext
Raw Normal View History

2024-04-19 03:23:30 +03:30
@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();
}
}