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

萌新求教, Electron 在请求跨域的接口时,怎么获取 cookie?

  •  
  •   mietl ·
    mietl · Oct 21, 2024 · 3556 views
    This topic created in 565 days ago, the information mentioned may be changed or developed.
    接口地址 http://bgm.tv/login

    使用 axios 请求 withCredentials 有设置 true


    1. 尝试在 cookie 中添加 Secure; SameSite=None 但是 Secure 只在 https 协议上生效


    2. 关闭 webPreferences webSecurity 安全性也不行


    请问还有其他办法吗?
    mietl
        1
    mietl  
    OP
       Oct 21, 2024
    LuckyLauncher
        2
    LuckyLauncher  
       Oct 21, 2024
    都 electron 了,就把跨域关了呗
    mietl
        3
    mietl  
    OP
       Oct 21, 2024
    跨域关了没有用、响应头里能看到 cookie 、 但是 axios 或 fetch 中响应头不会包含
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3044 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 14:02 · PVG 22:02 · LAX 07:02 · JFK 10:02
    ♥ Do have faith in what you're doing.