From fea594af0d46d41b1f1f0e9efdd5f7adaa0c16ef Mon Sep 17 00:00:00 2001 From: anghunk Date: Mon, 9 Feb 2026 15:51:59 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=B0=86"=E5=9F=9F=E5=90=8D"=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BF=AE=E6=94=B9=E4=B8=BA"=E7=AB=99=E7=82=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新文档和前端界面中的术语,将"按域名统计"改为"按站点统计",使术语更准确。 同时修复默认站点ID的处理逻辑,并添加缺失的统计API路由。 --- cwd-admin/src/views/LayoutView/index.vue | 6 +++--- cwd-admin/src/views/StatsView/index.vue | 2 +- cwd-api/src/index.ts | 1 + docs/api/admin/stats.md | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cwd-admin/src/views/LayoutView/index.vue b/cwd-admin/src/views/LayoutView/index.vue index 879da16..e05caae 100644 --- a/cwd-admin/src/views/LayoutView/index.vue +++ b/cwd-admin/src/views/LayoutView/index.vue @@ -217,11 +217,11 @@ function cycleTheme() { type SiteOption = { label: string; value: string }; const siteOptions = ref([]); -const defaultSiteId = ""; +const defaultSiteId = "default"; function getSiteLabel(value: string) { - if (!value) { - return "默认站点 (Default)"; + if (!value || value === "default") { + return "默认站点"; } return value; } diff --git a/cwd-admin/src/views/StatsView/index.vue b/cwd-admin/src/views/StatsView/index.vue index 3e5a99d..77db3d9 100644 --- a/cwd-admin/src/views/StatsView/index.vue +++ b/cwd-admin/src/views/StatsView/index.vue @@ -74,7 +74,7 @@
-

按域名统计

+

按站点统计

加载中...
{{ statsError }}
diff --git a/cwd-api/src/index.ts b/cwd-api/src/index.ts index 8f90091..c716df9 100644 --- a/cwd-api/src/index.ts +++ b/cwd-api/src/index.ts @@ -292,6 +292,7 @@ app.get('/admin/export/config', exportConfig); app.post('/admin/import/config', importConfig); app.get('/admin/export/stats', exportStats); app.post('/admin/import/stats', importStats); +app.get('/admin/stats/comments', getStats); app.get('/admin/export/backup', exportBackup); app.post('/admin/import/backup', importBackup); app.put('/admin/comments/status', updateStatus); diff --git a/docs/api/admin/stats.md b/docs/api/admin/stats.md index 39b3338..8a84c8d 100644 --- a/docs/api/admin/stats.md +++ b/docs/api/admin/stats.md @@ -14,7 +14,7 @@ Authorization: Bearer GET /admin/stats/comments ``` -用于管理后台「数据看板」展示评论整体统计、按域名统计以及最近 30 天评论趋势。 +用于管理后台「数据看板」展示评论整体统计、按站点统计以及最近 30 天评论趋势。 - 方法:`GET` - 路径:`/admin/stats/comments`