首页 > 解决方案 > 混合内容错误 - 通过 HTTPS 提供服务时,swagger-ui 应该更喜欢 HTTPS API 协议

问题描述

当要招摇 ui 链接时,我在控制台中看到错误>

Mixed Content: The page at 'https://***url***/api/documentation/ui' was loaded over HTTPS, but requested an insecure favicon 'http://***url***/swagger-ui-assets/favicon-16x16.png?v=47568366ac424fb77af3e26dce55c7cd'. This request has been blocked; the content must be served over HTTPS.

等等所有资产

我已经修改了我们正在生成文档的女巫的 API 文档 json 文件。这部分并将http更改为https

"components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "description": "Passport security.",
                "scheme": "bearer",
                "bearerFormat": "JWT"
            }
        }
    }

我希望在看到 swagger UI 时不会收到此错误

标签: swagger-uiswagger-3.0

解决方案


推荐阅读