Actualiser admin/login.html
This commit is contained in:
+2
-8
@@ -31,19 +31,13 @@
|
|||||||
const API_URL = '../api.php';
|
const API_URL = '../api.php';
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
// Si déjà connecté, rediriger vers le dashboard
|
|
||||||
if (localStorage.getItem('token')) {
|
|
||||||
window.location.href = 'dashboard.html';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const formBlock = document.getElementById('login-form-block');
|
const formBlock = document.getElementById('login-form-block');
|
||||||
const blankBlock = document.getElementById('blank-setup-block');
|
const blankBlock = document.getElementById('blank-setup-block');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_URL}?action=check_security_status`);
|
const res = await fetch(`${API_URL}?action=check_security_status`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
console.log("Statut sécurité reçu :", data); // Ajoutez ceci pour voir en console
|
console.log("DEBUG - Statut sécurité :", data); // OUVREZ LA CONSOLE F12 POUR VOIR CE RÉSULTAT
|
||||||
|
|
||||||
if (data.is_blank) {
|
if (data.is_blank) {
|
||||||
formBlock.style.display = 'none';
|
formBlock.style.display = 'none';
|
||||||
@@ -53,7 +47,7 @@
|
|||||||
blankBlock.style.display = 'none';
|
blankBlock.style.display = 'none';
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.error("Erreur API :", e); // Remplacez console.warn par console.error pour voir l'erreur
|
console.error("Erreur API :", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user