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

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

  •  
  •   mietl ·
    mietl · 1 天前 · 161 次点击
    接口地址 http://bgm.tv/login

    使用 axios 请求 withCredentials 有设置 true


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


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


    请问还有其他办法吗?
    3 条回复
    mietl
        1
    mietl  
    OP
       1 天前
    LuckyLauncher
        2
    LuckyLauncher  
       1 天前
    都 electron 了,就把跨域关了呗
    mietl
        3
    mietl  
    OP
       1 天前
    跨域关了没有用、响应头里能看到 cookie 、 但是 axios 或 fetch 中响应头不会包含
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3212 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 11:50 · PVG 19:50 · LAX 04:50 · JFK 07:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.