...
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
return Ok(new VerificationCodeDto {
|
return Ok(new VerificationCodeDto {
|
||||||
ID = ID,
|
ID = ID,
|
||||||
Code="",
|
Code=0,
|
||||||
prm= _getVerificationValidation.verificationCode.prm,
|
prm= _getVerificationValidation.verificationCode.prm,
|
||||||
Type= _getVerificationValidation.verificationCode.Type,
|
Type= _getVerificationValidation.verificationCode.Type,
|
||||||
val= _getVerificationValidation.verificationCode.val
|
val= _getVerificationValidation.verificationCode.val
|
||||||
|
@@ -9,15 +9,14 @@ namespace Shared.DTOs
|
|||||||
{
|
{
|
||||||
public class VerificationCodeDto
|
public class VerificationCodeDto
|
||||||
{
|
{
|
||||||
[Required(ErrorMessage ="ID نمیتواند خالی باشد")]
|
// [Required(ErrorMessage ="ID نمیتواند خالی باشد")]
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
[Required(ErrorMessage = "کد نمیتواند خالی باشد")]
|
public int Code { get; set; }
|
||||||
public string Code { get; set; }
|
// [Required(ErrorMessage = "prm نمیتواند خالی باشد")]
|
||||||
[Required(ErrorMessage = "prm نمیتواند خالی باشد")]
|
|
||||||
public string prm { get; set; }
|
public string prm { get; set; }
|
||||||
[Required(ErrorMessage = "val نمیتواند خالی باشد")]
|
// [Required(ErrorMessage = "val نمیتواند خالی باشد")]
|
||||||
public string val { get; set; }
|
public string val { get; set; }
|
||||||
[Required(ErrorMessage = "Type نمیتواند خالی باشد")]
|
// [Required(ErrorMessage = "Type نمیتواند خالی باشد")]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,18 +46,16 @@
|
|||||||
|
|
||||||
|
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
|
<div class="postbox__comment-input mb-35">
|
||||||
|
<ValidationMessage For="()=>VerificationCodeModel.Code" />
|
||||||
|
|
||||||
|
</div>
|
||||||
<InputNumber @bind-Value="VerificationCodeModel.ID" id="ID" />
|
|
||||||
<InputText @bind-Value="VerificationCodeModel.prm" id="prm" type="text" class="inputText" required="" />
|
|
||||||
<InputText @bind-Value="VerificationCodeModel.val" id="val" type="text" class="inputText" required="" />
|
|
||||||
<InputText @bind-Value="VerificationCodeModel.Type" id="Type" type="text" class="inputText" required="" />
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="postbox__comment-input mb-30">
|
<div class="postbox__comment-input mb-30">
|
||||||
<InputText @bind-Value="VerificationCodeModel.Code" id="Code" type="text" class="inputText" required="" />
|
<InputNumber @bind-Value="VerificationCodeModel.Code" id="Code" type="text" class="inputText" required="" />
|
||||||
<span class="floating-label">کد تائید</span>
|
<span class="floating-label">کد تائید</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,16 +63,13 @@
|
|||||||
<button type="submit" class="signin-btn">احراز</button>
|
<button type="submit" class="signin-btn">احراز</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="postbox__comment-input mb-35">
|
|
||||||
<ValidationMessage For="()=>VerificationCodeModel.ID" />
|
|
||||||
<ValidationMessage For="()=>VerificationCodeModel.Code" />
|
|
||||||
<ValidationMessage For="()=>VerificationCodeModel.prm" />
|
|
||||||
<ValidationMessage For="()=>VerificationCodeModel.val" />
|
|
||||||
<ValidationMessage For="()=>VerificationCodeModel.Type" />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</EditForm>
|
</EditForm>
|
||||||
|
<div class="row">
|
||||||
|
<label style="color:red">
|
||||||
|
@Error
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="signin-banner-from-register">
|
<div class="signin-banner-from-register">
|
||||||
<NavLink href="Register">کد ارسال نشد؟ <span>ارسال مجدد</span></NavLink>
|
<NavLink href="Register">کد ارسال نشد؟ <span>ارسال مجدد</span></NavLink>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,11 +84,11 @@
|
|||||||
@code {
|
@code {
|
||||||
private EditContext? editContext;
|
private EditContext? editContext;
|
||||||
private ValidationMessageStore? messageStore;
|
private ValidationMessageStore? messageStore;
|
||||||
|
public string Error{ get; set; }
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
|
|
||||||
// [SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
public VerificationCodeDto? VerificationCodeModel { get; set; } = new VerificationCodeDto();
|
public VerificationCodeDto? VerificationCodeModel { get; set; } = new VerificationCodeDto();
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
@@ -109,7 +104,6 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
VerificationCodeModel = await request.Content.ReadFromJsonAsync<VerificationCodeDto>();
|
VerificationCodeModel = await request.Content.ReadFromJsonAsync<VerificationCodeDto>();
|
||||||
// nav.NavigateTo($"Verification/{res}");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -122,11 +116,17 @@
|
|||||||
@functions {
|
@functions {
|
||||||
|
|
||||||
private async Task SubmitVerificationCode()
|
private async Task SubmitVerificationCode()
|
||||||
|
{
|
||||||
|
Error = "";
|
||||||
|
if (VerificationCodeModel.Code < 1000 || VerificationCodeModel.Code > 9000)
|
||||||
|
{
|
||||||
|
Error = "کد احراز صحیح نمی باشد";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var request = await _hc.PostAsJsonAsync($"Verification/Submit", VerificationCodeModel);
|
var request = await _hc.PostAsJsonAsync($"Verification/Submit", VerificationCodeModel);
|
||||||
if (request.IsSuccessStatusCode)
|
if (request.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
|
|
||||||
var status = await request.Content.ReadFromJsonAsync<bool>();
|
var status = await request.Content.ReadFromJsonAsync<bool>();
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
@@ -136,6 +136,8 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// nav.NavigateTo($"Verification/{res}");
|
// nav.NavigateTo($"Verification/{res}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -143,4 +145,6 @@
|
|||||||
nav.NavigateTo($"/");
|
nav.NavigateTo($"/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user