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

ajax 跨域获取 header 的问题

  •  
  •   sarices · 2020-01-03 12:09:15 +08:00 · 736 次点击
    这是一个创建于 1591 天前的主题,其中的信息可能已经有所发展或是发生改变。

    已经设置好 access-control-allow-headers 也已经有响应响应字段,但是 axios 获取响应只有 content-type,有朋友试过吗?我想获取 authorization,更新本地 token

    access-control-allow-credentials: true
    access-control-allow-headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With
    access-control-allow-methods: GET, POST, PATCH, PUT, DELETE
    access-control-allow-origin: *
    authorization: Bearer 1121
    content-type: application/json; charset=utf-8
    date: Fri, 03 Jan 2020 03:51:56 GMT
    server: nginx
    status: 200```
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3121 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:30 · PVG 21:30 · LAX 06:30 · JFK 09:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.