hduwillsky
V2EX  ›  问与答

请教各位前端大佬

  •  
  •   hduwillsky · Dec 29, 2017 · 1850 views
    This topic created in 3151 days ago, the information mentioned may be changed or developed.

    各位大佬:

    我自己做的一个博客前端页面现在遇到一个问题:

    使用 vue :src 绑定 img 地址,html 源码里地址正确,为什么 chrome 请求的时候会重组地址? 比如 html 中为 src="https://api.xx.com/files/" 但从 chrome network 中看请求的地址变成了https://本站 url/api.xxx.com/files/

    html 没有设置 base,api.xx.com 使用 ajax 请求正常。

    3 replies    2017-12-29 12:27:11 +08:00
    morethansean
        1
    morethansean  
       Dec 29, 2017
    你确定标签里 src 是 "https://api.xx.com/files/" ?
    根据你说的现象,src 应该漏写了 "https://"
    hduwillsky
        2
    hduwillsky  
    OP
       Dec 29, 2017
    @morethansean 没有漏写, 博客地址 https://mymid.me
    hduwillsky
        3
    hduwillsky  
    OP
       Dec 29, 2017
    @morethansean 知道问题了,https:// 被后端 clean 掉了一个 /
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2768 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 02:24 · PVG 10:24 · LAX 19:24 · JFK 22:24
    ♥ Do have faith in what you're doing.