Datatable Jquery 显示错误,通知请求未安全地使用 HTTPS

Datatable Jquery displays an error, informing that the request was not made safely, using HTTPS

在我的 ASP.NET 核心 MVC 应用程序中,我使用的是 Identity。奇怪的是,即使它已通过身份验证并具有正确的权限,数据表仍会显示错误,通知未使用 HTTPS 安全地发出请求。我该怎么做才能解决这个问题?

谢谢:)

var table = dataTableObj.DataTable({
    "select": true,
    "processing": false,
    "serverSide": true,
    "filter": true,
    "orderMulti": false,
    "ordering": true,
    "order": [[1, "asc"]],
    "ajax": {
        "url": '/servico-web-gerenciar/getServicoWeb',
        "type": "POST",
        "datatype": "json",
        "error": function (e) {
            stopLoadGlobal();

            redirectToError(e.status);

            return false;
        }
    }
});

[HttpPost]
[Authorize]
[Route("servico-web-gerenciar/getServicoWeb")]
public JsonResult GetServicoWeb()
{
    var draw = Request.Form["draw"];
    var start = Request.Form["start"];
    var length = Request.Form["length"];

    var search = Request.Form["search[value]"];

    int pageSize = !string.IsNullOrEmpty(length) ? Convert.ToInt32(length) : 0;
    int skip = !string.IsNullOrEmpty(start) ? Convert.ToInt32(start) : 0;
    int totalRecords = 0;
    int recordsFiltered = 0;

    var documentoTipo = _servicoWebAppService.GetPaginated(search, skip, pageSize, out totalRecords, out recordsFiltered, true);

    return Json(new
    {
        draw = draw,
        recordsFiltered = recordsFiltered,
        recordsTotal = totalRecords,
        data = documentoTipo,
    });
}

error

Mixed Content: The page at 'https://localhost:44373/xxxx' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Roboto+Mono'. This request has been blocked; the content must be served over HTTPS.

您可以查看此文档以了解有关“混合内容阻止”的更多信息:

https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content

要解决此问题,应删除所有对 HTTP 内容的请求并替换为通过 HTTPS 提供的内容。

而且我发现您正在访问的源也可以通过 HTTPS 访问,您可以尝试通过 HTTPS 加载它,如下所示。

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono" />