nouvelle page html
This commit is contained in:
parent
cfbf0d7471
commit
854b8250d3
9
web/html/home.html
Normal file
9
web/html/home.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Coucou</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Bienvenue</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,5 +1,5 @@
|
|||||||
instance.get("token", { withCredentials: true})
|
instance.get("token", { withCredentials: true})
|
||||||
.then(function(response) { console.log(response) })
|
.then(function(response) { location.href="html/home.html"; })
|
||||||
.catch(function(error){
|
.catch(function(error){
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -9,9 +9,8 @@ document.getElementById("signin").addEventListener("submit", function(evt){
|
|||||||
var pseudo = document.getElementById("floatingPseudo");
|
var pseudo = document.getElementById("floatingPseudo");
|
||||||
var password = document.getElementById("floatingPassword");
|
var password = document.getElementById("floatingPassword");
|
||||||
if((password.value.length > 0) || (pseudo.value.length > 0)){
|
if((password.value.length > 0) || (pseudo.value.length > 0)){
|
||||||
console.log(pseudo.value);
|
|
||||||
instance.get("token", { auth : {username: pseudo.value, password: password.value}, withCredentials: true})
|
instance.get("token", { auth : {username: pseudo.value, password: password.value}, withCredentials: true})
|
||||||
.then(function(response) { console.log(response) })
|
.then(function(response) { location.href="html/home.html"; })
|
||||||
.catch(function(error){
|
.catch(function(error){
|
||||||
|
|
||||||
switch (error.response.status){
|
switch (error.response.status){
|
||||||
@ -30,8 +29,7 @@ document.getElementById("signin").addEventListener("submit", function(evt){
|
|||||||
default:
|
default:
|
||||||
id = "alertUnknown";
|
id = "alertUnknown";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById(id).classList.remove("hidden");
|
document.getElementById(id).classList.remove("hidden");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user