From 9f0f8f69aff87004f2556238ddf231bea2a149ca Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Sun, 30 Nov 2025 11:03:55 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=B7=BB=E5=8A=A0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=8C=81=E4=B9=85?= =?UTF-8?q?=E5=8C=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 刷新页面后管理员标签页保持不变(概览/设置/监控/用户/工具) - 使用localStorage存储当前标签页状态 - 登出时自动清理保存的标签页状态 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/app.js b/frontend/app.js index e7a78f4..8251521 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1003,6 +1003,7 @@ handleDragLeave(e) { this.stopTokenRefresh(); localStorage.removeItem('user'); localStorage.removeItem('lastView'); + localStorage.removeItem('adminTab'); this.showResendVerify = false; this.resendVerifyEmail = ''; @@ -1066,6 +1067,14 @@ handleDragLeave(e) { targetView = 'files'; } + // 恢复管理员标签页 + if (this.user.is_admin) { + const savedAdminTab = localStorage.getItem('adminTab'); + if (savedAdminTab && ['overview', 'settings', 'monitor', 'users', 'tools'].includes(savedAdminTab)) { + this.adminTab = savedAdminTab; + } + } + // 强制切换到目标视图并加载数据 this.switchView(targetView, true); } @@ -2886,6 +2895,12 @@ handleDragLeave(e) { if (this.isLoggedIn && this.isViewAllowed(newView)) { localStorage.setItem('lastView', newView); } + }, + // 记住管理员当前标签页 + adminTab(newTab) { + if (this.isLoggedIn && this.user?.is_admin) { + localStorage.setItem('adminTab', newTab); + } } } }).mount('#app');