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

ajax 跨域获取 header 的问题

  •  
  •   sarices · 2020 年 1 月 3 日 · 969 次点击
    这是一个创建于 2287 天前的主题,其中的信息可能已经有所发展或是发生改变。

    已经设置好 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   ·   Solana   ·   5896 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 213ms · UTC 02:03 · PVG 10:03 · LAX 19:03 · JFK 22:03
    ♥ Do have faith in what you're doing.