From 5fe750fbd4e9db204596e9261210a48ae6fea05a Mon Sep 17 00:00:00 2001 From: que01 Date: Sat, 19 Sep 2026 09:14:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A5=E5=85=A5=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/index.html | 1 + apps/admin/package.json | 1 + apps/admin/src/main.ts | 14 ++++++++++++++ packages/api-client/package.json | 1 + 4 files changed, 17 insertions(+) create mode 100644 apps/admin/index.html diff --git a/apps/admin/index.html b/apps/admin/index.html new file mode 100644 index 0000000..67ddfe5 --- /dev/null +++ b/apps/admin/index.html @@ -0,0 +1 @@ +品牌后台
diff --git a/apps/admin/package.json b/apps/admin/package.json index 5f52006..5ec53ab 100644 --- a/apps/admin/package.json +++ b/apps/admin/package.json @@ -2,6 +2,7 @@ "name": "@personal-brand/admin", "private": true, "type": "module", + "dependencies": { "@personal-brand/api-client": "workspace:*" }, "scripts": { "build": "tsc -p tsconfig.json", "dev": "tsc -p tsconfig.json --watch", diff --git a/apps/admin/src/main.ts b/apps/admin/src/main.ts index 053e8ed..0117b3c 100644 --- a/apps/admin/src/main.ts +++ b/apps/admin/src/main.ts @@ -1 +1,15 @@ +import type { ApiClient } from "@personal-brand/api-client"; + +export interface AdminDashboardOptions { client: ApiClient; root: HTMLElement } + +export class AdminDashboard { + constructor(private readonly options: AdminDashboardOptions) {} + + async load(): Promise { + const { root, client } = this.options; + const [bookings, unread] = await Promise.all([client.listAdminBookings(), client.getAdminUnreadCount()]); + root.innerHTML = `

品牌后台

未读订单:${unread.count}

`; + } +} + export const adminAppName = "personal-brand-admin"; diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 2d1ffb8..05f69f6 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -2,6 +2,7 @@ "name": "@personal-brand/api-client", "private": true, "type": "module", + "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } }, "scripts": { "build": "tsc -p tsconfig.json", "lint": "eslint .",