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 服务后刷新重试。"} ); }