This commit is contained in:
mmrbnjd
2025-07-24 23:18:11 +03:30
parent 4977be215c
commit d4c4bb2ffd
20 changed files with 2285 additions and 65 deletions

View File

@@ -1,4 +1,5 @@
using Hushian.Application;
using Hushian.Infrastructure;
using Hushian.Persistence;
using Hushian.WebApi;
@@ -12,7 +13,10 @@ builder.Services.AddOpenApi();
builder.Services.ConfigureApplicationServices(builder.Configuration);
builder.Services.ConfigurePersistenceServices(builder.Configuration);
builder.Services.ConfigureInfrastractureServices(builder.Configuration);
builder.Services.AddSignalR();
var app = builder.Build();
// Configure the HTTP request pipeline.
@@ -21,7 +25,6 @@ if (app.Environment.IsDevelopment())
app.MapOpenApi();
}
app.MapHub<ChatNotificationHub>("/chatNotificationHub");
app.UseHttpsRedirection();

View File

@@ -6,19 +6,33 @@
@inject NavigationManager navigation;
<div class="header-form">
<img src="/before/assets/images/Hushian-logo.svg" width="133" alt="Hushian" class="lg:hidden mb-3">
<span>@Title</span>
<span style="font-size: small;white-space: pre-line;">@Title</span>
</div>
<p></p>
@if (type == VerificationCodeType.ForgetPassword)
{
<div style="display: flex; justify-content: space-between">
<TextInput @bind-value=code type="text" name="code" style="text-align:center;margin-left: 10px;" placeholder="کد ارسال شده" required="required" />
<div style="justify-content: space-between;margin-top:5px;;margin-bottom:15px">
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code1" @oninput="MoveNext"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input1" />
</div>
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code2" @oninput="MoveNext"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input2" />
<div style="display: flex; justify-content: space-between">
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code3" @oninput="MoveNext"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input3" />
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code4" @oninput="OnLastInput"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input4" />
</div>
<div style="justify-content: space-between">
<TextInput @bind-value=Value type="password" name="Value" style="text-align:center;margin-top: 10px;;margin-left: 10px" placeholder="کلمه عبور جدید" required="required" />
<TextInput @bind-value=ReValue type="password" name="ReValue" style="text-align:center;margin-top: 10px;;margin-left: 10px" placeholder="تکرار کلمه عبور جدید" required="required" />
@@ -28,10 +42,28 @@
}
else
{
<div style="display: flex; justify-content: space-between">
<TextInput @bind-value=code type="text" name="code" style="text-align:center;margin-left: 10px;" placeholder="کد ارسال شده" required="required" />
<div style="justify-content: space-between;margin-top:5px">
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code1" @oninput="MoveNext"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input1" />
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code2" @oninput="MoveNext"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input2" />
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code3" @oninput="MoveNext"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input3" />
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
@bind="code4" @oninput="OnLastInput"
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
@ref="input4" />
<Button Loading=loading LoadingText="ارسال درخواست" @onclick=onClick Color="ButtonColor.Success"> احراز </Button>
</div>
}
@@ -59,6 +91,10 @@ else
bool loading = false;
string resendmsg = "ارسال مجدد";
bool Disabledresendmsg = false;
//-----------------
private string code1, code2, code3, code4;
private ElementReference input1, input2, input3, input4;
}
@functions {
protected override async Task OnParametersSetAsync()
@@ -125,5 +161,35 @@ else
}
loading = false;
}
private async Task MoveNext(ChangeEventArgs e)
{
if (e.Value?.ToString()?.Length == 1)
{
if (input1.Context == null) return;
if (string.IsNullOrEmpty(code1))
await input2.FocusAsync();
else if (string.IsNullOrEmpty(code2))
await input3.FocusAsync();
else if (string.IsNullOrEmpty(code3))
await input4.FocusAsync();
else if (string.IsNullOrEmpty(code4))
{
code = $"{code1}{code2}{code3}{code4}";
}
}
}
private async Task OnLastInput(ChangeEventArgs e)
{
code4 = e.Value?.ToString();
if (!string.IsNullOrEmpty(code4) && code4.Length == 1)
{
code = $"{code1}{code2}{code3}{code4}";
if(type==VerificationCodeType.PhoneNumberConfirmed)
await onClick();
}
}
}

View File

@@ -91,7 +91,7 @@
parameters.Add("sendValue", Username);
parameters.Add("ID", 0);
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<VerificationCodeType>(this, CallBackVer));
parameters.Add("Title", "بازیابی کلمه عبور");
parameters.Add("Title", "بازیابی کلمه عبور" + '\n' + "برای تکمیل کد پبامک شده را وارد کنید");
await modal.ShowAsync<Verification>(title: "احراز", parameters: parameters);
}
async Task CallBackVer(VerificationCodeType type)

View File

@@ -23,7 +23,7 @@
کاربر گرامی، لطفاً توجه فرمایید که شماره‌همراه واردشده به نام خودتان باشد .
</div>
</div>
<form id="primary_form" class="form" method="post">
<form id="primary_form" class="form">
<div class=" group w-full">
<label class="block mb-2 text-slate-600 font-bold" for="PhoneNumber">
شماره همراه
@@ -91,7 +91,7 @@
</div> *@
<div class=" space-y-5 flex flex-col items-center">
<Button Loading=Loading LoadingText="منتظر بمانید" @onclick=onClick Color="ButtonColor.Success" Type="ButtonType.Submit" Class="btn-primary w-full mb-4 lg:mb-0"> ثبت نام </Button>
<Button Loading=Loading LoadingText="منتظر بمانید" @onclick=onClick Color="ButtonColor.Success" Type="ButtonType.Button" Class="btn-primary w-full mb-4 lg:mb-0"> ثبت نام </Button>
</div>
@@ -120,6 +120,7 @@
}
async Task onClick()
{
//-----------validate
if (string.IsNullOrEmpty(FullName))
{
@@ -167,7 +168,7 @@
parameters.Add("type", VerificationCodeType.PhoneNumberConfirmed);
parameters.Add("sendValue", PhoneNumber);
parameters.Add("ID", ID);
parameters.Add("Title", "ثبت نام با موفقیت انجام شد برای استفاده کاربری را احرار کنید");
parameters.Add("Title", "ثبت نام با موفقیت انجام شد" +'\n'+ "برای تکمیل کد پبامک شده را وارد کنید");
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<VerificationCodeType>(this, CallBackVer));
await modal.ShowAsync<Verification>(title: "احراز", parameters: parameters);
}

View File

@@ -8,7 +8,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5137/api/") });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5089/api/") });
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
builder.Services.AddScoped<BaseController>();
builder.Services.AddScoped<AuthService>();