From e6805d0b75b399ecc7810551325ef4f8640b82e5 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Sun, 12 Apr 2026 17:15:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=99=BB=E5=BD=95API=E8=B7=AF=E5=BE=84=EF=BC=88=E6=94=B9?= =?UTF-8?q?=E4=B8=BA/admin/api/login=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/templates/login.html | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/admin/templates/login.html b/admin/templates/login.html index 133a99f..bb895c3 100644 --- a/admin/templates/login.html +++ b/admin/templates/login.html @@ -18,7 +18,7 @@

后台管理系统

-

请输入管理员账号登录

+

管理员账号: admin / admin123

@@ -26,7 +26,7 @@
-
@@ -36,7 +36,7 @@
-
@@ -63,10 +63,10 @@ // 检查是否已登录 async function checkAuth() { try { - const res = await fetch('/api/check-auth'); + const res = await fetch('/admin/api/check-auth'); const data = await res.json(); if (data.logged_in) { - window.location.href = '/'; + window.location.href = '/admin'; } } catch (e) { // 未登录,继续显示登录页面 @@ -89,7 +89,7 @@ btn.innerHTML = ' 登录中...'; try { - const res = await fetch('/api/login', { + const res = await fetch('/admin/api/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username, password }) @@ -113,6 +113,4 @@ }); -> - -> \ No newline at end of file + \ No newline at end of file