From 145171464f4f22081ed9240abf6c7a3755f37446 Mon Sep 17 00:00:00 2001 From: shaw Date: Thu, 18 Dec 2025 22:11:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 版本号闪烁问题 - 将版本信息缓存到 Pinia store,避免每次路由切换都重新请求 - 添加加载占位符,版本为空时显示骨架屏 2. 管理员登录跳转问题 - 管理员登录后现在正确跳转到 /admin/dashboard - 普通用户仍跳转到 /dashboard 3. Dashboard 页面空白报错 - 修复 API 返回 null 时访问 .length 导致的 TypeError - 为 computed 属性添加可选链操作符保护 - 为数据赋值添加空数组默认值 --- .../src/components/common/VersionBadge.vue | 58 ++++++-------- frontend/src/router/index.ts | 5 +- frontend/src/stores/app.ts | 79 ++++++++++++++++++- frontend/src/views/admin/DashboardView.vue | 6 +- frontend/src/views/user/DashboardView.vue | 9 ++- 5 files changed, 112 insertions(+), 45 deletions(-) diff --git a/frontend/src/components/common/VersionBadge.vue b/frontend/src/components/common/VersionBadge.vue index 93c77e0d..c19afd12 100644 --- a/frontend/src/components/common/VersionBadge.vue +++ b/frontend/src/components/common/VersionBadge.vue @@ -12,7 +12,8 @@ ]" :title="hasUpdate ? 'New version available' : 'Up to date'" > - v{{ currentVersion }} + v{{ currentVersion }} + @@ -56,7 +57,8 @@
- v{{ currentVersion }} + v{{ currentVersion }} + -- @@ -233,8 +235,8 @@