From 25a049d607de2288b494421bd1354c247e967b16 Mon Sep 17 00:00:00 2001 From: fawney19 Date: Fri, 12 Dec 2025 20:22:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=B1=E4=BA=AB=E8=A7=86=E5=9B=BE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 改进 Dashboard 和 Usage 页面 --- frontend/src/views/shared/Dashboard.vue | 2 +- frontend/src/views/shared/Usage.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/shared/Dashboard.vue b/frontend/src/views/shared/Dashboard.vue index c577f53..91bbbb1 100644 --- a/frontend/src/views/shared/Dashboard.vue +++ b/frontend/src/views/shared/Dashboard.vue @@ -1101,7 +1101,7 @@ async function viewAnnouncementDetail(announcement: Announcement) { try { await announcementApi.markAsRead(announcement.id) announcement.is_read = true - } catch {} + } catch { /* 静默忽略标记已读错误 */ } } selectedAnnouncement.value = announcement detailDialogOpen.value = true diff --git a/frontend/src/views/shared/Usage.vue b/frontend/src/views/shared/Usage.vue index 52cd154..98ad391 100644 --- a/frontend/src/views/shared/Usage.vue +++ b/frontend/src/views/shared/Usage.vue @@ -109,6 +109,7 @@ import { } from '@/features/usage/composables' import type { PeriodValue, FilterStatusValue } from '@/features/usage/types' import type { UserOption } from '@/features/usage/components/UsageRecordsTable.vue' +import { log } from '@/utils/logger' const route = useRoute() const authStore = useAuthStore() @@ -250,7 +251,7 @@ async function pollActiveRequests() { await refreshData() } } catch (error) { - console.error('轮询活跃请求状态失败:', error) + log.error('轮询活跃请求状态失败:', error) } } @@ -423,7 +424,7 @@ async function exportData(format: 'csv' | 'json') { a.click() window.URL.revokeObjectURL(url) } catch (error) { - console.error('导出失败:', error) + log.error('导出失败:', error) } }