From 27bcfde6c90b2e586e81557bf06355c4be06b007 Mon Sep 17 00:00:00 2001 From: xiangning Date: Mon, 11 May 2026 02:43:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Jenkinsfile=20=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=20Node.js=20=E4=BA=8C=E8=BF=9B=E5=88=B6=20+?= =?UTF-8?q?=20=E5=89=8D=E7=AB=AF=E5=AF=B9=E6=8E=A5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Jenkinsfile: 从 nodejs.org 下载 Node.js 二进制(容器无法访问 GitHub) - vite.config.ts: 代理目标改为后端实际端口 5211,去掉 rewrite - auth.ts: withCredentials 移到 axios config 正确位置 --- apps/web-antd/src/api/core/auth.ts | 16 ++++++++++------ apps/web-antd/vite.config.ts | 4 +--- packages/types/src/user.ts | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/apps/web-antd/src/api/core/auth.ts b/apps/web-antd/src/api/core/auth.ts index 71d9f99..cc83542 100644 --- a/apps/web-antd/src/api/core/auth.ts +++ b/apps/web-antd/src/api/core/auth.ts @@ -29,18 +29,22 @@ export async function loginApi(data: AuthApi.LoginParams) { * 刷新accessToken */ export async function refreshTokenApi() { - return baseRequestClient.post('/auth/refresh', { - withCredentials: true, - }); + return baseRequestClient.post( + '/auth/refresh', + {}, + { withCredentials: true }, + ); } /** * 退出登录 */ export async function logoutApi() { - return baseRequestClient.post('/auth/logout', { - withCredentials: true, - }); + return baseRequestClient.post( + '/auth/logout', + {}, + { withCredentials: true }, + ); } /** diff --git a/apps/web-antd/vite.config.ts b/apps/web-antd/vite.config.ts index b6360f1..4f73277 100644 --- a/apps/web-antd/vite.config.ts +++ b/apps/web-antd/vite.config.ts @@ -8,9 +8,7 @@ export default defineConfig(async () => { proxy: { '/api': { changeOrigin: true, - rewrite: (path) => path.replace(/^\/api/, ''), - // mock代理目标地址 - target: 'http://localhost:5320/api', + target: 'http://localhost:5211', ws: true, }, }, diff --git a/packages/types/src/user.ts b/packages/types/src/user.ts index 44dc5b4..e132b92 100644 --- a/packages/types/src/user.ts +++ b/packages/types/src/user.ts @@ -12,9 +12,9 @@ interface UserInfo extends BasicUserInfo { homePath: string; /** - * accessToken + * accessToken(登录时由 loginApi 单独返回,userInfo 可选) */ - token: string; + token?: string; } export type { UserInfo };