From 4a6cd3adc60673c015794319d3c0da7880c6a40b Mon Sep 17 00:00:00 2001 From: que01 Date: Tue, 22 Sep 2026 23:23:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E8=A7=86=E8=A7=89=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/features/workspace/WorkspacePage.tsx | 30 +++++++++++++++++++ docs/template-runtime-progress.md | 1 + packages/api-client/src/index.ts | 6 ++++ 3 files changed, 37 insertions(+) diff --git a/apps/admin/src/features/workspace/WorkspacePage.tsx b/apps/admin/src/features/workspace/WorkspacePage.tsx index 86f72ce..c0ab037 100644 --- a/apps/admin/src/features/workspace/WorkspacePage.tsx +++ b/apps/admin/src/features/workspace/WorkspacePage.tsx @@ -38,6 +38,17 @@ export function WorkspacePage() { queryKey: ["public-runtime-workspace"], queryFn: () => client.getPublicWorkspace(), }); + const visualTemplate = useMutation({ + mutationFn: (key: string) => + client.updateAdminBrand({ + config: { ...(runtimeQuery.data?.brand?.config ?? {}), visualTemplateKey: key }, + }), + onSuccess: () => { + message.success("视觉模板已切换"); + void runtimeQuery.refetch(); + void queryClient.invalidateQueries({ queryKey: ["admin-brand"] }); + }, + }); const install = useMutation({ mutationFn: (key: "personal" | "food") => client.installAdminTemplate(key), onSuccess: () => { @@ -157,6 +168,25 @@ export function WorkspacePage() { 小程序和后台预览消费同一份 Runtime Workspace;模板 key 只用于安装和版本管理,不作为客户端业务分支。 + + 视觉模板 +