route
This commit is contained in:
@@ -18,11 +18,12 @@ namespace Back.Controllers
|
||||
private readonly servSendMsg _servSendMsg;
|
||||
private readonly servCompany _servCompany;
|
||||
public VerificationController(ServValidatinMsg servValidatinMsg, GetVerificationValidation getVerificationValidation
|
||||
, servCompany servCompany)
|
||||
, servCompany servCompany, servSendMsg servSendMsg)
|
||||
{
|
||||
_servValidatinMsg = servValidatinMsg;
|
||||
_getVerificationValidation = getVerificationValidation;
|
||||
_servCompany = servCompany;
|
||||
_servSendMsg = servSendMsg;
|
||||
}
|
||||
[HttpGet("GetVerification/{ID}")]
|
||||
[AllowAnonymous]
|
||||
|
@@ -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">
|
||||
@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();
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
@page "/"
|
||||
@inject Services.localService servlocal;
|
||||
@page "/"
|
||||
|
||||
<PageTitle>Home</PageTitle>
|
||||
|
||||
@@ -40,10 +41,21 @@
|
||||
<p class="wow tpfadeUp" data-wow-duration=".9s" data-wow-delay=".7s">
|
||||
فروش بیشتر با مدیریت بهتر کسب و کار
|
||||
</p>
|
||||
@if (servlocal.OnlineUser().Result)
|
||||
{
|
||||
<NavLink class="tp-btn" href="Panel">
|
||||
<span>ورود به برنامه</span>
|
||||
<b></b>
|
||||
</NavLink>
|
||||
}
|
||||
else
|
||||
{
|
||||
<NavLink class="tp-btn" href="Sign-in">
|
||||
<span>شروع کنید</span>
|
||||
<b></b>
|
||||
</NavLink>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -197,10 +209,21 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tp-about__btn">
|
||||
@if (servlocal.OnlineUser().Result)
|
||||
{
|
||||
<NavLink class="tp-btn" href="Panel">
|
||||
<span>ورود به برنامه</span>
|
||||
<b></b>
|
||||
</NavLink>
|
||||
}
|
||||
else
|
||||
{
|
||||
<NavLink class="tp-btn" href="Sign-in">
|
||||
<span>شروع کنید</span>
|
||||
<b></b>
|
||||
</NavLink>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -351,10 +374,21 @@
|
||||
<div class="tp-service__dashboard" data-background="image.jpg" style="background-image: url('img/service/sv-bg.jpg');">
|
||||
<div class="tp-service__top-content">
|
||||
<p>راه حلی برای مدیریت بهتر صورتحساب ها</p>
|
||||
@if (servlocal.OnlineUser().Result)
|
||||
{
|
||||
<NavLink class="tp-btn-orange" href="Panel">
|
||||
<span>ورود به برنامه</span>
|
||||
<b></b>
|
||||
</NavLink>
|
||||
}
|
||||
else
|
||||
{
|
||||
<NavLink class="tp-btn-orange" href="Sign-in">
|
||||
<span>شروع کنید</span>
|
||||
<b></b>
|
||||
</NavLink>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
<div class="tp-service__dashdboard-sm-img">
|
||||
|
15
TaxPayerFull/Pages/Panel.razor
Normal file
15
TaxPayerFull/Pages/Panel.razor
Normal file
@@ -0,0 +1,15 @@
|
||||
@page "/Panel"
|
||||
@using Front.Services
|
||||
@inject localService localserv;
|
||||
@inject NavigationManager nav
|
||||
<h3>Panel</h3>
|
||||
@* @layout null *@
|
||||
@code {
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (!await localserv.OnlineUser())
|
||||
nav.NavigateTo("/");
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
@page "/Sign-in"
|
||||
@page "/Sign-in/{from}"
|
||||
@using Front.Services
|
||||
@using Shared.DTOs
|
||||
@inject ILocalStorageService Storage;
|
||||
@@ -116,7 +117,11 @@
|
||||
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||||
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||||
@alertMessage
|
||||
@if (showbtn)
|
||||
{
|
||||
<Button Color="ButtonColor.Primary" @onclick="EndForm">اتمام عملیات</Button>
|
||||
|
||||
}
|
||||
</Alert>
|
||||
|
||||
|
||||
@@ -133,6 +138,9 @@
|
||||
</main>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string from { get; set; } = "";
|
||||
bool showbtn = false;
|
||||
[SupplyParameterFromForm]
|
||||
public Authentication? Model { get; set; }
|
||||
// alert
|
||||
@@ -140,11 +148,19 @@
|
||||
IconName alertIconName = IconName.CheckCircleFill;
|
||||
bool Hidealert = true;
|
||||
string alertMessage = "";
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (from == "Verification")
|
||||
{
|
||||
ShowSuccessAlert("ثبت نام شما با موفقیت انجام شد");
|
||||
}
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
if (await localserv.OnlineUser())
|
||||
nav.NavigateTo("/");
|
||||
nav.NavigateTo("/Panel");
|
||||
|
||||
Model ??= new();
|
||||
await base.OnInitializedAsync();
|
||||
@@ -153,11 +169,20 @@
|
||||
@functions {
|
||||
private void ShowDangerAlert(string msg)
|
||||
{
|
||||
showbtn = true;
|
||||
Hidealert = false;
|
||||
alertColor = AlertColor.Danger;
|
||||
alertIconName = IconName.ExclamationTriangleFill;
|
||||
alertMessage = msg;
|
||||
}
|
||||
private void ShowSuccessAlert(string msg)
|
||||
{
|
||||
showbtn = false;
|
||||
Hidealert = false;
|
||||
alertColor = AlertColor.Success;
|
||||
alertIconName = IconName.CheckCircleFill;
|
||||
alertMessage = msg;
|
||||
}
|
||||
private async Task EndForm() => nav.NavigateTo("/");
|
||||
|
||||
|
||||
@@ -184,7 +209,7 @@
|
||||
userinfo.enterDate = userinfomodel.enterDate;
|
||||
|
||||
|
||||
nav.NavigateTo("/");
|
||||
nav.NavigateTo("/Panel");
|
||||
}
|
||||
else if (request.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
ShowDangerAlert("کاربری با این مشخصات یافت نشد");
|
||||
|
@@ -142,8 +142,11 @@
|
||||
var status = await request.Content.ReadFromJsonAsync<bool>();
|
||||
if (status)
|
||||
{
|
||||
ShowSuccessAlert("عملیات با موفقیت انجام شد");
|
||||
successfull = true;
|
||||
if (VerificationCodeModel.Type == "CompanyRegistration")
|
||||
nav.NavigateTo("/Sign-in/Verification");
|
||||
else
|
||||
nav.NavigateTo("/");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user