【问题标题】:Browser is making an HTTP call after reloading an angular webpage浏览器在重新加载 Angular 网页后进行 HTTP 调用
【发布时间】:2021-09-16 04:40:32
【问题描述】:

您好,我正在做一个 Angular 项目,我要调用的 API 很少。我已将 API Url 设置为

const SERVER_URL = https://api.example.com

它工作得非常好,除非我在成功调用 API 后重新加载页面,然后再次进行 API 调用..

我收到了 CORS 错误:

[blocked] The page at https://staging.example.com was not allowed to display insecure content from http://api.example.com

有人知道我哪里做错了吗?因为我的其他项目很少,而且我也使用相同的编码实践,但它们工作得非常好..

PS:后端在 Django 中

【问题讨论】:

标签: django angular http https


【解决方案1】:

我认为这是因为您从不安全的 API 获取数据。(HTTP)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-07
    • 1970-01-01
    • 2017-12-26
    • 1970-01-01
    • 2019-05-31
    • 1970-01-01
    • 2017-03-19
    相关资源
    最近更新 更多