fix: 修复后台配置接口与管理后台高优先级问题

This commit is contained in:
que01 committed 2026-09-19 18:20:51 +08:00
1 parent 69bbeb1b1b
commit c393a5231e
6 files changed
+53 -14

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ if (root) {
event.preventDefault();
const username = (root.querySelector("#username") as HTMLInputElement).value;
const password = (root.querySelector("#password") as HTMLInputElement).value;
try { const client = new ApiClient({ baseUrl: "http://localhost:3001", fetcher: (input, init) => fetch(input, init) }); const result = await client.loginAdmin(username, password); localStorage.setItem("adminToken", result.token); location.reload(); } catch (error) { alert(error instanceof Error ? error.message : "登录失败"); }
try { const client = new ApiClient({ baseUrl: import.meta.env.VITE_API_BASE_URL ?? "http://localhost:3001", fetcher: (input, init) => fetch(input, init) }); const result = await client.loginAdmin(username, password); localStorage.setItem("adminToken", result.token); location.reload(); } catch (error) { alert(error instanceof Error ? error.message : "登录失败"); }
});
} else bootstrapAdmin(root);
}