Hansah
V2EX  ›  问与答

如何正确的调用七牛云对象存储里的 css/js?

  •  
  •   Hansah · Apr 3, 2019 · 3255 views
    This topic created in 2788 days ago, the information mentioned may be changed or developed.
    自定义域名已备案正常访问,直接复制 css/js 的外链地址到浏览器上可以正常访问打开,但是 html 里面引用就无法读取,请问应该如何操作?谢谢
    6 replies  •  2019-04-03 16:56:20 +08:00
    walkersz
    walkersz
    Apr 3, 2019
    1
    可以看下 content-type 是否有问题
    Hansah
    Hansah
    OP
    Apr 3, 2019
    2
    @walkersz

    F12 显示引用出错的 css 如下信息:
    Request URL:http://cdn.lebome.com/route/assets/theme/css/style.css
    Referrer Policy:no-referrer-when-downgrade


    Request Headers
    Provisional headers are shown

    没发现 content-type 在哪啊?
    ithou
    ithou
    Apr 3, 2019 via Android
    3
    如何正确地…
    tongz
    tongz
    Apr 3, 2019
    4
    关键词: 同源
    tongz
    tongz
    Apr 3, 2019
    5
    对应存储里一般有防盗链设置, 看看
    Hansah
    Hansah
    OP
    Apr 3, 2019
    6
    @ithou
    @tongz
    @walkersz

    搞定了,页面是 https,css 是 http,https 遇到 http 内容会直接过滤掉。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2758 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:18 · PVG 18:18 · LAX 02:18 · JFK 05:18
    ♥ Do have faith in what you're doing.