Separate base database initialization from test data seeding

This commit is contained in:
2026-07-20 19:49:29 +08:00 Unverified
parent 5b86cdaec2
commit b8f2799ed6
11 changed files with 345 additions and 43 deletions
-6
View File
@@ -120,12 +120,6 @@ document.addEventListener('click', async event => {
state.user = null; state.profile = null; state.pageData = null; state.permissions = []; state.scopeLabel = '';
await refreshPublic(); navigate('home'); toast('已安全退出', '期待下次见面'); return;
}
if (action === 'fill-demo') {
const form = document.querySelector('[data-form="login"]');
const accounts = { admin: ['admin', 'Admin123!'], school: ['school_admin', 'School123!'], class: ['class_admin', 'Class123!'], candidate: ['2026-HZ01-F-0001', 'Candidate123!'] };
[form.username.value, form.password.value] = accounts[target.dataset.type] || accounts.candidate;
return;
}
if (action === 'open-notice') {
const notice = state.publicData.notices.find(item => item.id === target.dataset.id) || (await api(`/api/public/notices/${target.dataset.id}`)).notice;
const contentHtml = notice.contentHtml || `<p>${h(notice.content).replace(/\r?\n/g, '</p><p>')}</p>`;