From 1b4a74c23df527561f89b6de7fc72ea59e3cced0 Mon Sep 17 00:00:00 2001 From: Victor_Jay Date: Sat, 30 May 2026 20:58:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=B4=E6=8A=A4=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E4=B8=8E?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E4=B8=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - maintenance.enabled 默认 false,但 JS 用 registration 同逻辑导致首次显示为 ON - 分离 maintenance 判断:仅当保存过 true 时才显示 ON - registration 保持原逻辑(默认 true,仅当 !== false 时 ON) --- templates/admin/static/js/site-settings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/admin/static/js/site-settings.js b/templates/admin/static/js/site-settings.js index b3afa7c..941820a 100644 --- a/templates/admin/static/js/site-settings.js +++ b/templates/admin/static/js/site-settings.js @@ -36,7 +36,9 @@ var el = document.getElementById(t.id); if (!el) return; - if (t.id === 'maintenance-enabled' || t.id === 'registration-enabled') { + if (t.id === 'maintenance-enabled') { + el.checked = allSettings[t.key] === 'true'; + } else if (t.id === 'registration-enabled') { el.checked = allSettings[t.key] !== 'false'; } else { el.checked = audit[t.key.split('.')[1]] === true;