diff --git a/public/js/app.js b/public/js/app.js index 299bbe0..e39c720 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -82,10 +82,11 @@ const App = { showPublic(page, param) { document.getElementById('top-bar').classList.remove('hidden'); - document.getElementById('top-auth').classList.remove('hidden'); document.getElementById('main-layout').classList.add('hidden'); const pub = document.getElementById('public-page'); pub.classList.remove('hidden'); + const topAuth = document.getElementById('top-auth'); + if (Auth.logged()) { topAuth.classList.add('hidden'); } else { topAuth.classList.remove('hidden'); } 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 = '
请刷新页面重试