feat: password reset + data-action delegation for all onclick

This commit is contained in:
2026-07-15 02:45:33 +08:00
parent f0e891b17c
commit 0f64af42a1
5 changed files with 101 additions and 3 deletions

View File

@@ -63,6 +63,7 @@ const App = {
if (page === 'install') { this.showPublic('install'); return; }
if (page === 'home') { this.showPublic('home', param); return; }
if (page === 'login' || page === 'register') { this.showPublic(page); return; }
if (page === 'forgot' || page === 'reset') { this.showPublic(page); return; }
if (!Auth.logged()) { location.hash = '#/login'; return; }
this.showLayout();
@@ -98,7 +99,7 @@ const App = {
const pub = document.getElementById('public-page');
pub.classList.remove('hidden');
this.updateTopAuth();
const comp = page === 'login' ? LoginPage : page === 'register' ? RegisterPage : page === 'install' ? InstallPage : HomePage;
const comp = page === 'login' ? LoginPage : page === 'register' ? RegisterPage : page === 'install' ? InstallPage : page === 'forgot' ? ForgotPage : page === 'reset' ? ResetPage : 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>';
});
@@ -167,6 +168,8 @@ window.PollsPage = PollsPage;
window.FeaturesPage = FeaturesPage;
window.LoginPage = LoginPage;
window.RegisterPage = RegisterPage;
window.ForgotPage = ForgotPage;
window.ResetPage = ResetPage;
window.HomePage = HomePage;
window.InstallPage = InstallPage;
window.U = U;