From eb70a0c6f6f88b5bcf53d496646f591412133200 Mon Sep 17 00:00:00 2001 From: jingrow Date: Sun, 4 Jan 2026 19:11:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=99=BB=E5=BD=95=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96cookie=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 /api/action 和 /api/data 代理添加 cookieDomainRewrite 和 cookiePathRewrite 配置 - 将 secure 设置为 false 以支持开发环境的证书验证 - 确保后端返回的 cookie 能在开发服务器正确传递和保存 --- vite.config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 26772d2..bf65407 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -68,12 +68,16 @@ export default defineConfig(({ mode, command }) => { '/api/action': { target: JCLOUD_URL, changeOrigin: true, - secure: true, + secure: false, + cookieDomainRewrite: { '*': '' }, + cookiePathRewrite: { '*': '/' }, }, '/api/data': { target: JCLOUD_URL, changeOrigin: true, - secure: true, + secure: false, + cookieDomainRewrite: { '*': '' }, + cookiePathRewrite: { '*': '/' }, }, '/api/v1/tools': { target: BACKEND_URL,