/* * MC Report System * Copyright (C) 2026 Sea Network Technology Studio * Author: CangLan * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ const LoginPage = { async render() { return `
还没有账号?立即注册 | 匿名提交
`; }, mount() { document.getElementById('login-form').addEventListener('submit', async e => { e.preventDefault(); const btn = e.target.querySelector('button'); btn.disabled = true; btn.innerHTML = ' 登录中...'; try { await Auth.login(document.getElementById('lu').value.trim(), document.getElementById('lp').value.trim()); App.afterLogin(); } catch (err) { const el = document.getElementById('le'); el.textContent = err.message; el.classList.remove('hidden'); btn.disabled = false; btn.innerHTML = ' 登录'; } }); } };