server_photo_s85js/public/js/admin/config.js
2026-08-11 08:45:04 +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);