V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
hduwillsky
V2EX  ›  问与答

请教各位前端大佬

  •  
  •   hduwillsky · 2017-12-29 11:39:43 +08:00 · 1451 次点击
    这是一个创建于 2311 天前的主题,其中的信息可能已经有所发展或是发生改变。

    各位大佬:

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

    使用 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 条回复    2017-12-29 12:27:11 +08:00
    morethansean
        1
    morethansean  
       2017-12-29 12:09:43 +08:00
    你确定标签里 src 是 "https://api.xx.com/files/" ?
    根据你说的现象,src 应该漏写了 "https://"
    hduwillsky
        2
    hduwillsky  
    OP
       2017-12-29 12:26:19 +08:00
    @morethansean 没有漏写, 博客地址 https://mymid.me
    hduwillsky
        3
    hduwillsky  
    OP
       2017-12-29 12:27:11 +08:00
    @morethansean 知道问题了,https:// 被后端 clean 掉了一个 /
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2934 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:49 · PVG 16:49 · LAX 01:49 · JFK 04:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.