From 52af1008fee1e893207d69a81dad59326684d051 Mon Sep 17 00:00:00 2001 From: Wren Date: Fri, 12 Sep 2025 12:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3=E5=92=8C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=89=8D=E7=AB=AFJWT=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/routes/documents._index.tsx | 7 ++++--- app/routes/files.upload.tsx | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/routes/documents._index.tsx b/app/routes/documents._index.tsx index a333760..7e911b8 100644 --- a/app/routes/documents._index.tsx +++ b/app/routes/documents._index.tsx @@ -38,7 +38,7 @@ export const meta: MetaFunction = () => { export const loader = async ({ request }: LoaderFunctionArgs) => { // 获取用户会话信息 const { getUserSession } = await import("~/api/login/auth.server"); - const { userInfo } = await getUserSession(request); + const { userInfo, frontendJWT } = await getUserSession(request); // 获取URL查询参数,只保留必要的分页参数 const url = new URL(request.url); @@ -61,6 +61,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => { pageSize, documentTypeOptions, userInfo, // 传递用户信息到客户端 + frontendJWT, // 传递前端JWT到客户端 initialLoad: true // 标记这是初始加载 }); }; @@ -793,7 +794,7 @@ export default function DocumentsIndex() { attachmentMergeMode, true, // isReprocess attachmentRemark || undefined, - loaderData.userInfo?.token as string | undefined + loaderData.frontendJWT as string | undefined ); if (result.error) { @@ -865,7 +866,7 @@ export default function DocumentsIndex() { templateFile, selectedDocumentId, undefined, // comparisonId - loaderData.userInfo?.token as string | undefined + loaderData.frontendJWT as string | undefined ); if (result.error) { diff --git a/app/routes/files.upload.tsx b/app/routes/files.upload.tsx index b9270fe..3daf344 100644 --- a/app/routes/files.upload.tsx +++ b/app/routes/files.upload.tsx @@ -921,7 +921,7 @@ export default function FilesUpload() { attachmentMergeMode, true, // isReprocess attachmentRemark || undefined, - loaderData.userInfo?.token as string | undefined + loaderData.frontendJWT as string | undefined ); if (result.error) { @@ -991,7 +991,7 @@ export default function FilesUpload() { templateFile, selectedDocumentId, undefined, // comparisonId - loaderData.userInfo?.token as string | undefined + loaderData.frontendJWT as string | undefined ); if (result.error) {