From aeb7eb732227764be2cdf88a0b01d84208aad010 Mon Sep 17 00:00:00 2001 From: que01 Date: Sun, 20 Sep 2026 13:33:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=98=8E=E7=A1=AE=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=E7=99=BB=E5=BD=95=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/features/workspace/WorkspacePage.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/admin/src/features/workspace/WorkspacePage.tsx b/apps/admin/src/features/workspace/WorkspacePage.tsx index b80bbfb..69d3cda 100644 --- a/apps/admin/src/features/workspace/WorkspacePage.tsx +++ b/apps/admin/src/features/workspace/WorkspacePage.tsx @@ -1,6 +1,7 @@ import { Button, Card, Form, Input, Modal, Select, Space, Table, Tag, message } from "antd"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { createApiClient } from "../../lib/api.js"; +import { ApiClientError } from "@personal-brand/api-client"; import type { BrandFieldDefinition, BrandModule } from "@personal-brand/api-client"; import { useState } from "react"; @@ -56,7 +57,26 @@ export function WorkspacePage() { }, }); if (query.isLoading) return ; - if (query.isError || !query.data) return 工作空间加载失败,请刷新重试。; + if (query.isError || !query.data) { + const expired = query.error instanceof ApiClientError && query.error.status === 401; + return ( + window.dispatchEvent(new Event("admin-auth-expired"))} + > + 重新登录 + + ) : undefined + } + > + {expired ? "请重新登录后再访问工作空间。" : "请检查 API 服务后刷新重试。"} + + ); + } const { modules, fields, installations } = query.data; return (