diff --git a/admin/src/views/Dashboard.vue b/admin/src/views/Dashboard.vue index 654b010..c3a193c 100644 --- a/admin/src/views/Dashboard.vue +++ b/admin/src/views/Dashboard.vue @@ -7,6 +7,21 @@
{{ d.stats?.aiChatUsed ?? '-' }}AI 问答次数{{ d.stats?.aiChatUsers ?? 0 }} 人用过
{{ d.stats?.totalTrends ?? '-' }}趋势资讯含人话解读 {{ d.stats?.trendsWithExplain ?? 0 }}
{{ d.stats?.paidOrders ?? '-' }}付费订单共 {{ d.stats?.totalOrders ?? 0 }} 单
+
{{ visit.pvToday ?? '-' }}今日访问 PV小程序 + H5
+
{{ visit.uvToday ?? '-' }}今日访客 UV按 IP 去重
+
{{ visit.h5Today ?? '-' }}H5 访问小程序 {{ visit.miniToday ?? 0 }} 次
+ + +
+
+

访问来源分布(近 7 天)

+
+ {{ s.source }} +
+ {{ s.count }} +
+
+
@@ -47,13 +62,19 @@ import { ref, onMounted } from 'vue' import { apiGet } from '../api' const d = ref({}) +const visit = ref({}) function pct(n) { const max = Math.max(1, ...(d.value.litByDim || []).map(b => b.count)) return Math.round((n / max) * 100) + '%' } +function srcPct(n) { + const max = Math.max(1, ...(visit.value.sources7d || []).map(s => s.count)) + return Math.round((n / max) * 100) + '%' +} function fmt(t) { return t ? new Date(t).toLocaleString('zh-CN', { hour12: false }) : '-' } onMounted(async () => { d.value = (await apiGet('/api/admin/dashboard-v2')) || {} + try { visit.value = (await apiGet('/api/admin/visit-stats')) || {} } catch (e) { visit.value = {} } }) diff --git a/admin/src/views/Logs.vue b/admin/src/views/Logs.vue index fe4e0a6..3620d5e 100644 --- a/admin/src/views/Logs.vue +++ b/admin/src/views/Logs.vue @@ -2,6 +2,7 @@
+ @@ -20,6 +21,16 @@ +