sarices
V2EX  ›  问与答

ajax 跨域获取 header 的问题

  •  
  •   sarices · Jan 3, 2020 · 1054 views
    This topic created in 2321 days ago, the information mentioned may be changed or developed.

    已经设置好 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```
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3333 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:12 · PVG 21:12 · LAX 06:12 · JFK 09:12
    ♥ Do have faith in what you're doing.