fix: home page tabs in top bar, single nav layer

This commit is contained in:
2026-07-17 13:21:30 +08:00
parent 8f7c34dd86
commit 9eb8aba371
2 changed files with 41 additions and 68 deletions

View File

@@ -67,7 +67,7 @@ const App = {
}
if (page === 'install') { this.showPublic('install'); return; }
if (page === 'home') { this.showPublic('home', param); document.getElementById('top-auth').classList.add('hidden'); return; }
if (page === 'home') { this.showPublic('home', param); return; }
if (page === 'login' || page === 'register' || page === 'forgot' || page === 'reset') { this.showPublic(page); return; }
if (!Auth.logged()) { location.hash = '#/login'; return; }
@@ -107,7 +107,7 @@ const App = {
document.getElementById('main-layout').classList.add('hidden');
const pub = document.getElementById('public-page');
pub.classList.remove('hidden');
this.updateTopAuth();
if (page !== 'home') this.updateTopAuth();
const comp = page === 'login' ? LoginPage : page === 'register' ? RegisterPage : page === 'install' ? InstallPage : HomePage;
comp.render(param).then(html => { pub.innerHTML = html; if (comp.mount) comp.mount(param); }).catch(() => {
pub.innerHTML = '<div class="pub-card"><div class="logo"><i class="fas fa-exclamation-triangle" style="color:var(--d)"></i><h2>加载失败</h2><p>请刷新页面重试</p></div></div>';