msg
This commit is contained in:
@@ -142,15 +142,15 @@ namespace Back.Controllers
|
||||
|
||||
await _servPermission.AddPermissionUser(roluser.ID, allper.Select(s => s.ID).ToArray());
|
||||
|
||||
var ID = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
var modelvc = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
{
|
||||
prm = company.ID.ToString(),
|
||||
val = user.ID.ToString(),
|
||||
Type = "CompanyRegistration"
|
||||
});
|
||||
|
||||
_servSendMsg.Authentication(company.Mobile, ID.ToString());
|
||||
return Ok(ID);
|
||||
_servSendMsg.toContinue(modelvc.Code.ToString(), company.Mobile, "ثبت نام");
|
||||
return Ok(modelvc.ID);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -176,15 +176,15 @@ namespace Back.Controllers
|
||||
if (!resultValidationmodel.IsValid)
|
||||
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
||||
|
||||
var ID = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
var modelvc = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
{
|
||||
prm = Item.Username,
|
||||
val = Item.PassWord,
|
||||
Type = "ForgetPassword"
|
||||
});
|
||||
|
||||
_servSendMsg.Authentication(Item.Username, ID.ToString());
|
||||
return Ok(ID);
|
||||
_servSendMsg.toContinue(modelvc.Code.ToString(),Item.Username, "فراموشی کلمه عبور");
|
||||
return Ok(modelvc.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -123,14 +123,14 @@ namespace Back.Controllers
|
||||
item.CompanyID = pid.Value.ToString();
|
||||
var Ticket = await _servTicket.NewTicket(item, StatusTicket.unknownPerson);
|
||||
|
||||
var ID = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
var modelvc = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
{
|
||||
prm = Ticket.ID.ToString(),
|
||||
val = item.Mobile,
|
||||
Type = "NewTicketNoAuthentication"
|
||||
});
|
||||
_servSendMsg.Authentication(item.Mobile, ID.ToString());
|
||||
return Ticket == null ? BadRequest() : Ok(ID);
|
||||
_servSendMsg.toContinue(modelvc.Code.ToString(),item.Mobile, "ثبت نظر");
|
||||
return Ticket == null ? BadRequest() : Ok(modelvc.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -69,15 +69,15 @@ namespace Back.Controllers
|
||||
|
||||
var UserID = HttpContext.User.Claims.First(c => c.Type == "UserID").Value;
|
||||
|
||||
var ID = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
var modelvc = await _servValidatinMsg.GenerateCode(new VerificationCode
|
||||
{
|
||||
prm = UserID,
|
||||
val = newUsername,
|
||||
Type = "ChangeUserName"
|
||||
});
|
||||
|
||||
_servSendMsg.Authentication(newUsername, ID.ToString());
|
||||
return Ok(ID);
|
||||
_servSendMsg.toContinue(modelvc.Code.ToString(),newUsername, "تغییر نام کاربری");
|
||||
return Ok(modelvc.ID);
|
||||
|
||||
// return Ok(await _servUser.ChangeUserName(newUsername, Convert.ToInt32(UserID)));
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ namespace Back.Controllers
|
||||
_servUser = servUser;
|
||||
}
|
||||
[HttpGet("GetVerification/{ID}")]
|
||||
[AllowAnonymous]
|
||||
|
||||
public async Task<ActionResult<VerificationCode>> GetVerification(int ID)
|
||||
{
|
||||
var resultValidationmodel = await _getVerificationValidation.ValidateAsync(ID);
|
||||
@@ -44,7 +44,7 @@ namespace Back.Controllers
|
||||
});;
|
||||
}
|
||||
[HttpGet("ReSend/{ID}")]
|
||||
[AllowAnonymous]
|
||||
|
||||
public async Task<ActionResult> ReSend(int ID)
|
||||
{
|
||||
var resultValidationmodel = await _getVerificationValidation.ValidateAsync(ID);
|
||||
@@ -55,23 +55,23 @@ namespace Back.Controllers
|
||||
switch (_getVerificationValidation.verificationCode.Type)
|
||||
{
|
||||
case "NewTicketNoAuthentication":
|
||||
_servSendMsg.Authentication(_getVerificationValidation.verificationCode.val, ID.ToString());
|
||||
_servSendMsg.toContinue(_getVerificationValidation.verificationCode.Code.ToString(), _getVerificationValidation.verificationCode.val,"ثبت نظر");
|
||||
break;
|
||||
|
||||
case "CompanyRegistration":
|
||||
var company=await _servCompany.GetCompanyOrg(Convert.ToInt32(_getVerificationValidation.verificationCode.prm),false);
|
||||
_servSendMsg.Authentication(company.Mobile, ID.ToString());
|
||||
_servSendMsg.toContinue(_getVerificationValidation.verificationCode.Code.ToString(),company.Mobile, "ثبت نام");
|
||||
break;
|
||||
|
||||
|
||||
case "ForgetPassword":
|
||||
var user = await _servUser.ChangePasswordByMobile(_getVerificationValidation.verificationCode.prm, _getVerificationValidation.verificationCode.val);
|
||||
_servSendMsg.Authentication(_getVerificationValidation.verificationCode.prm, ID.ToString());
|
||||
// var user = await _servUser.ChangePasswordByMobile(_getVerificationValidation.verificationCode.prm, _getVerificationValidation.verificationCode.val);
|
||||
_servSendMsg.toContinue(_getVerificationValidation.verificationCode.Code.ToString(), _getVerificationValidation.verificationCode.prm, "فراموشی کلمه عبور");
|
||||
break;
|
||||
|
||||
|
||||
case "ChangeUserName":
|
||||
_servSendMsg.Authentication(_getVerificationValidation.verificationCode.val, ID.ToString());
|
||||
_servSendMsg.toContinue(_getVerificationValidation.verificationCode.Code.ToString(), _getVerificationValidation.verificationCode.val, "تغییر نام کاربری");
|
||||
break;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Back.Controllers
|
||||
return NoContent();
|
||||
}
|
||||
[HttpPost("Submit")]
|
||||
[AllowAnonymous]
|
||||
|
||||
public async Task<ActionResult<bool>> Submit(VerificationCodeDto item)
|
||||
{
|
||||
var VerificationCode= await _servValidatinMsg.GetVerificationCodeByID(item.ID);
|
||||
@@ -107,6 +107,11 @@ namespace Back.Controllers
|
||||
//else return BadRequest();
|
||||
break;
|
||||
|
||||
case "ForgetPassword":
|
||||
Sucstatus = await _servUser.ChangePasswordByMobile(VerificationCode.prm, VerificationCode.val);
|
||||
|
||||
break;
|
||||
|
||||
case "ChangeUserName":
|
||||
Sucstatus = await _servUser.ChangeUserName(VerificationCode.val, Convert.ToInt32(VerificationCode.prm));
|
||||
break;
|
||||
@@ -127,7 +132,7 @@ namespace Back.Controllers
|
||||
|
||||
}
|
||||
[HttpDelete("Remove/{ID}")]
|
||||
[AllowAnonymous]
|
||||
|
||||
public async Task<ActionResult<bool>> Remove(int ID)
|
||||
{
|
||||
var VerificationCode = await _servValidatinMsg.GetVerificationCodeByID(ID);
|
||||
|
Reference in New Issue
Block a user