我正在使用 PoliteCaptcha,如下所示:
<div class="form-container">
@using (Html.BeginForm("LogOn", "Account", new { ReturnUrl = Request.QueryString["ReturnUrl"] }, FormMethod.Post, new { id = "formLogOn" }))
{
@Html.TextBoxFor(model => model.UserId, new { id = "textBoxUserId", placeholder="Enter your username" })<br />
@Html.ValidationMessageFor(model => model.UserId)<br />
@Html.PasswordFor(model => model.Password, new { placeholder="Enter your password" })<br />
@Html.ValidationMessageFor(model => model.Password)<br />
@Html.SpamPreventionFields()
<input type="submit" id="ButtonLogOn" value="LoginButton" class=" button" />
}
</div>
<div id="validationSummary">
@Html.Partial("_AjaxValidationSummaryPartial")
</div>
@if (Model != null && !Model.ShowCatcha)
{
@Html.SpamPreventionScript()
}
这工作正常,但当它在 https 域上上线时就不行了。我得到错误:
混合内容:“ https://www.domain.com/log?ReturnUrl=%2Fadmin ”页面是通过 HTTPS 加载的,但请求了不安全的脚本“ http://www.google.com/recaptcha/api/challenge ” ?k=6LcAAAAOQuMiKA-yCo4HZPp4gy-T0x7CaX '。此请求已被阻止;内容必须通过 HTTPS 提供。