V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
icemanpro
V2EX  ›  Vue.js

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

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

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

    url 跳转只能用 GET 请求参数带上
    zm8m93Q1e5otOC69
        4
    zm8m93Q1e5otOC69  
       Apr 2, 2021
    跳转不能
    Balloonwj
        5
    Balloonwj  
       Apr 2, 2021
    下一个浏览器插件就可以了,例如 SmartHeader 。
    leven87
        6
    leven87  
       Apr 2, 2021
    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
        7
    shellus  
       Apr 2, 2021
    chrome 扩展:ModHeader
    opengps
        8
    opengps  
       Apr 2, 2021
    使用 js 函数控制跳转,避免 a 标签直接跳转
    sxbxjhwm
        9
    sxbxjhwm  
       Apr 2, 2021
    自己搭一个反向代理
    Alchemist13
        10
    Alchemist13  
       Apr 2, 2021
    @leven87 兄弟,为什么要在中文社区说英语,你会中文的吧 233
    Te11UA
        11
    Te11UA  
       Apr 2, 2021
    modheader 之类的 chrome 插件就能干
    leven87
        12
    leven87  
       Apr 2, 2021
    @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   ·   Solana   ·   1264 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 89ms · UTC 17:35 · PVG 01:35 · LAX 10:35 · JFK 13:35
    ♥ Do have faith in what you're doing.