window.Admin = { BASE_URL: null, token: localStorage.getItem("token"), db: [] }; if (!Admin.token) { window.location.href = "/login"; } async function loadConfig() { const res = await fetch("/config"); const cfg = await res.json(); Admin.BASE_URL = cfg.baseUrl; } document.addEventListener("DOMContentLoaded", loadConfig);