fix: hide top bar on home page, tabs back in page content

This commit is contained in:
2026-07-17 13:32:28 +08:00
parent d697ea1353
commit 0892dd5f8e
2 changed files with 18 additions and 16 deletions

View File

@@ -103,11 +103,15 @@ const App = {
},
showPublic(page, param) {
document.getElementById('top-bar').classList.remove('hidden');
document.getElementById('main-layout').classList.add('hidden');
const pub = document.getElementById('public-page');
pub.classList.remove('hidden');
if (page !== 'home') this.updateTopAuth();
if (page === 'home') {
document.getElementById('top-bar').classList.add('hidden');
} else {
document.getElementById('top-bar').classList.remove('hidden');
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>';