icemanpro
V2EX  ›  Vue.js

打开其它网站时,如何修改请求头?

  •  
  •   icemanpro · Apr 2, 2021 · 3979 views
    This topic created in 2045 days ago, the information mentioned may be changed or developed.
    要跳转到其它网站上,但要将 token 加到请求头内,有没有什么办法?
    12 replies  •  2021-04-02 22:16:44 +08:00
    no1xsyzy
    no1xsyzy
    Apr 2, 2021
    1
    跳转不能加任意头,只有 AJAX 请求可以加任意头。
    killergun
    killergun
    Apr 2, 2021
    2
    跳转应该只能加在 url 上
    shakaraka
    shakaraka
    Apr 2, 2021
    3
    啥意思?

    请求第三方 API ?如果是这样的话直接带上就好了啊(要 CORS )。

    url 跳转只能用 GET 请求参数带上
    zm8m93Q1e5otOC69
    zm8m93Q1e5otOC69
    Apr 2, 2021
    4
    跳转不能
    Balloonwj
    Balloonwj
    Apr 2, 2021
    5
    下一个浏览器插件就可以了,例如 SmartHeader 。
    leven87
    leven87
    Apr 2, 2021
    6
    For the description, I don't know. But request always could be based on http protocol, you could add token in the header part.
    shellus
    shellus
    Apr 2, 2021
    7
    chrome 扩展:ModHeader
    opengps
    opengps
    Apr 2, 2021
    8
    使用 js 函数控制跳转,避免 a 标签直接跳转
    sxbxjhwm
    sxbxjhwm
    Apr 2, 2021
    9
    自己搭一个反向代理
    Alchemist13
    Alchemist13
    Apr 2, 2021
    10
    @leven87 兄弟,为什么要在中文社区说英语,你会中文的吧 233
    Te11UA
    Te11UA
    Apr 2, 2021
    11
    modheader 之类的 chrome 插件就能干
    leven87
    leven87
    Apr 2, 2021
    12
    @Alchemist13 I just practice my English skill and don't want to forget. As well people here can understand.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   686 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 73ms · UTC 20:03 · PVG 04:03 · LAX 12:03 · JFK 15:03
    ♥ Do have faith in what you're doing.