From 4987689cb0f26cd0cfd1345b183c042c1c7884b3 Mon Sep 17 00:00:00 2001 From: que01 Date: Sun, 20 Sep 2026 13:57:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B1=95=E7=A4=BA=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=E7=9C=9F=E5=AE=9E=E8=AF=B7=E6=B1=82=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/features/workspace/WorkspacePage.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/admin/src/features/workspace/WorkspacePage.tsx b/apps/admin/src/features/workspace/WorkspacePage.tsx index 69d3cda..a6dd208 100644 --- a/apps/admin/src/features/workspace/WorkspacePage.tsx +++ b/apps/admin/src/features/workspace/WorkspacePage.tsx @@ -58,7 +58,11 @@ export function WorkspacePage() { }); if (query.isLoading) return ; if (query.isError || !query.data) { - const expired = query.error instanceof ApiClientError && query.error.status === 401; + const errorStatus = + query.error instanceof ApiClientError + ? query.error.status + : (query.error as { status?: number } | null)?.status; + const expired = errorStatus === 401; return ( 重新登录 - ) : undefined + ) : ( + + ) } > - {expired ? "请重新登录后再访问工作空间。" : "请检查 API 服务后刷新重试。"} + {expired + ? "请重新登录后再访问工作空间。" + : query.error instanceof Error + ? query.error.message + : "请检查 API 服务后刷新重试。"} ); }