server_photo_s35js/public/js/admin/config.js
2026-07-18 13:51:20 +02:00

17 lines
357 B
JavaScript

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);