You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/UserCenter/Views/Account/Validate.cshtml

37 lines
1.1 KiB

@model ValidateModel
@{
Layout = "/Views/Shared/_Layout.cshtml";
DisableBackUrl = true;
HtmlTitle = ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
}
@Html.EditorForModel()
@inject IConfiguration _cfg
@{
var total = _cfg.GetValue<int>("CaptchaSeconds");
var sec = total;
var session = this.Context.Session;
var model = session.Get<CodeCaptchaModel>(CodeCaptchaModel.Key);
if (model != null)
{
sec = (int)(model.ExpireDateUtc - DateTime.UtcNow).TotalSeconds;
}
var url = Url.Action("SendCodeToEmail");
}
@section scripts{
<script>
$(function () {
$('#Type').change(function () {
var value = $(this).find(':selected').val();
$('#CodeCaptcha').attr('data-url', value);
$('#Type').parents('form').validate().element('#Type');
});
});
function valid() {
return true;
}
function getUrl() {
return $('#CodeCaptcha').attr('data-url');
}
</script>
@await Html.PartialAsync("_Script")
}