From a6058bf2079a9a1bf2c6c71659ce97396c6b12d6 Mon Sep 17 00:00:00 2001 From: canglan Date: Sun, 12 Jul 2026 01:32:18 +0800 Subject: [PATCH] feat: top bar, footer, login/register buttons, ICP/copyright settings --- backend/routes/install.js | 2 ++ public/css/style.css | 9 +++++++++ public/index.html | 17 +++++++++++++++++ public/js/app.js | 13 +++++++++++++ public/js/pages/settings-page.js | 4 ++++ 5 files changed, 45 insertions(+) diff --git a/backend/routes/install.js b/backend/routes/install.js index 8841d86..107dc1c 100644 --- a/backend/routes/install.js +++ b/backend/routes/install.js @@ -73,6 +73,8 @@ router.post('/complete', async (req, res) => { for (const [k, v, l] of [ ['site_name', site_name || 'MC举报系统', '站点名称'], ['site_url', site_url || 'http://localhost:3100', '站点地址'], + ['copyright', '© 2024 MC举报系统', '页尾版权'], + ['icp', '', 'ICP备案号'], ]) { await conn.query("INSERT INTO settings(k, v, label) VALUES (?,?,?) ON DUPLICATE KEY UPDATE v=VALUES(v)", [k, v, l]); } diff --git a/public/css/style.css b/public/css/style.css index e9d78da..f3f5329 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -157,3 +157,12 @@ tbody tr:hover{background:var(--g50)} .detail-grid{grid-template-columns:1fr} .grid-2,.grid-3{grid-template-columns:1fr} } +#top-bar{background:var(--g900);color:white;position:sticky;top:0;z-index:200} +.top-bar-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:0 20px;height:48px} +.top-logo{color:white;text-decoration:none;font-size:16px;font-weight:700;display:flex;align-items:center;gap:8px} +.top-logo i{font-size:20px;color:var(--p)} +#top-auth{display:flex;gap:8px} +#page-footer{background:var(--g900);color:var(--g400);padding:16px 20px;font-size:13px;text-align:center} +.footer-inner{max-width:1200px;margin:0 auto;display:flex;justify-content:center;gap:24px;flex-wrap:wrap} +#app{min-height:calc(100vh - 48px);display:flex;flex-direction:column} +#public-page,#main-layout{flex:1} diff --git a/public/index.html b/public/index.html index 602923a..0bda9a2 100644 --- a/public/index.html +++ b/public/index.html @@ -8,6 +8,16 @@ +
+ +
+
+ + @@ -35,6 +37,8 @@ const SettingsPage = { await API.put('/settings/settings', { site_name: {value: document.getElementById('s-name').value, label:'站点名称'}, site_url: {value: document.getElementById('s-url').value, label:'站点地址'}, + copyright: {value: document.getElementById('s-copyright').value, label:'页尾版权'}, + icp: {value: document.getElementById('s-icp').value, label:'ICP备案号'}, }); alert('已保存'); } catch (ex) { alert(ex.message); }