From c634f0727e1b6b9764e4306e4cb2bf728c4625ea Mon Sep 17 00:00:00 2001 From: nap0o Date: Fri, 13 Mar 2026 13:24:00 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9BUI?= =?UTF-8?q?=E5=92=8CUE,=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7=E4=BD=93?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/app/router.js | 17 ++++------ .../styles/modules/components/migration.css | 18 +++++------ .../app/styles/modules/components/shared.css | 5 --- .../app/styles/modules/components/vault.css | 2 +- .../features/auth/views/securitySettings.vue | 9 +++++- .../backup/components/backupSettings.vue | 32 ++++++++++++++----- .../features/migration/views/dataImport.vue | 6 ++-- .../features/vault/components/appSidebar.vue | 10 +++--- frontend/src/locales/en-US.json | 4 +-- frontend/src/locales/zh-CN.json | 2 +- frontend/vite.config.js | 9 +++++- 11 files changed, 67 insertions(+), 47 deletions(-) diff --git a/frontend/src/app/router.js b/frontend/src/app/router.js index 8a76cb1..cdfd51a 100644 --- a/frontend/src/app/router.js +++ b/frontend/src/app/router.js @@ -38,40 +38,35 @@ const router = createRouter({ }) // 路由守卫:拦截未登录用户的访问 -router.beforeEach(async (to, from, next) => { +router.beforeEach(async (to) => { const authUserStore = useAuthUserStore() // 1. 检查内存中是否有用户信息 (乐观检查) let isAuthenticated = !!(authUserStore.userInfo && authUserStore.userInfo.id) // 2. 如果内存无状态,但目标页需要登录 OR 是仅游客页面(如登录页),尝试通过 Cookie 恢复会话 - // (Option 1B: 即使访问登录页,也先确认是否已登录,防止误判) if (!isAuthenticated && (to.meta.requiresAuth || to.meta.guestOnly)) { try { await authUserStore.fetchUserInfo() isAuthenticated = !!(authUserStore.userInfo && authUserStore.userInfo.id) } catch (e) { - // Handle the case where the application environment is unstable/not healthy if (e.isSecurity || e.message === 'Security Check Failed') { - next('/health') - return + return '/health' } } } // 3. 处理需要登录的页面 if (to.meta.requiresAuth && !isAuthenticated) { - next('/login') - return + return '/login' } - // 4. 处理仅限游客的页面 (Option 2B: 已登录用户访问登录页则跳转首页) + // 4. 处理仅限游客的页面 if (to.meta.guestOnly && isAuthenticated) { - next('/') - return + return '/' } - next() + return true }) export default router \ No newline at end of file diff --git a/frontend/src/app/styles/modules/components/migration.css b/frontend/src/app/styles/modules/components/migration.css index e7bd8b7..dd1c1d7 100644 --- a/frontend/src/app/styles/modules/components/migration.css +++ b/frontend/src/app/styles/modules/components/migration.css @@ -148,7 +148,7 @@ display: flex; flex-direction: column; gap: 16px; - padding: 20px 20px 0; + padding: 20px; background-color: none; border: 1px solid var(--el-border-color-lighter); border-radius: 12px; @@ -210,14 +210,14 @@ background-color: transparent; } -.ecosystem-collapse :deep(.el-collapse), -.ecosystem-collapse :deep(.el-collapse-item), -.ecosystem-collapse :deep(.el-collapse-item__header), -.ecosystem-collapse :deep(.el-collapse-item__wrap) { +.ecosystem-collapse, +.ecosystem-collapse .el-collapse-item, +.ecosystem-collapse .el-collapse-item__header, +.ecosystem-collapse .el-collapse-item__wrap { border: none !important; } -.ecosystem-collapse :deep(.el-collapse-item__header) { +.ecosystem-collapse .el-collapse-item__header { background-color: transparent; padding: 0; font-size: 13px; @@ -226,11 +226,11 @@ line-height: 32px; } -.ecosystem-collapse :deep(.el-collapse-item__wrap) { +.ecosystem-collapse .el-collapse-item__wrap { background-color: transparent; } -.ecosystem-collapse :deep(.el-collapse-item__content) { +.ecosystem-collapse .el-collapse-item__content { padding: 0; } @@ -321,6 +321,6 @@ html.dark .ecosystem-item:hover { padding: 10px; } -.migration-tabs :deep(.el-tabs__nav-wrap::after) { +.migration-tabs .el-tabs__nav-wrap::after { height: 1px; } \ No newline at end of file diff --git a/frontend/src/app/styles/modules/components/shared.css b/frontend/src/app/styles/modules/components/shared.css index cfb9fe8..2fa9d13 100644 --- a/frontend/src/app/styles/modules/components/shared.css +++ b/frontend/src/app/styles/modules/components/shared.css @@ -99,11 +99,6 @@ transform: translateY(-50%); } -html.dark .global-offline-banner { - background-color: rgba(230, 162, 60, 0.1); - border-bottom-color: rgba(230, 162, 60, 0.2); -} - /* 3. QrScanner Component */ .qr-scanner-container { width: 100%; diff --git a/frontend/src/app/styles/modules/components/vault.css b/frontend/src/app/styles/modules/components/vault.css index 55b51d6..c5873a0 100644 --- a/frontend/src/app/styles/modules/components/vault.css +++ b/frontend/src/app/styles/modules/components/vault.css @@ -262,7 +262,7 @@ /* AddVaultManual.vue */ .vault-manual-form-wrapper { - padding: 10px 0; + padding: 0; } .vault-manual-submit-btn { diff --git a/frontend/src/features/auth/views/securitySettings.vue b/frontend/src/features/auth/views/securitySettings.vue index fa9a8b0..3dac81a 100644 --- a/frontend/src/features/auth/views/securitySettings.vue +++ b/frontend/src/features/auth/views/securitySettings.vue @@ -242,7 +242,14 @@ const handleDelete = async (row) => { const formatDate = (timestamp) => { if (!timestamp) return '-' - return new Date(timestamp).toLocaleString() + const date = new Date(timestamp) + const Y = date.getFullYear() + const M = String(date.getMonth() + 1).padStart(2, '0') + const D = String(date.getDate()).padStart(2, '0') + const h = String(date.getHours()).padStart(2, '0') + const m = String(date.getMinutes()).padStart(2, '0') + const s = String(date.getSeconds()).padStart(2, '0') + return `${Y}-${M}-${D} ${h}:${m}:${s}` } onMounted(() => { diff --git a/frontend/src/features/backup/components/backupSettings.vue b/frontend/src/features/backup/components/backupSettings.vue index 41920ab..99ccb67 100644 --- a/frontend/src/features/backup/components/backupSettings.vue +++ b/frontend/src/features/backup/components/backupSettings.vue @@ -39,7 +39,7 @@

{{ $t('backup.last_backup') }} - {{ new Date(provider.lastBackupAt).toLocaleString() }} + {{ formatDate(provider.lastBackupAt) }} {{ $t('backup.never_backed_up') }} {{ provider.lastBackupStatus }} @@ -513,7 +513,11 @@ {{ formatSize(scope.row.size) }} - + + +