diff --git a/api-payroll/public/html/login.php b/api-payroll/public/html/login.php index e9e43c4..c9d4e1b 100644 --- a/api-payroll/public/html/login.php +++ b/api-payroll/public/html/login.php @@ -1,8 +1,11 @@ - - - + + + + + +
@@ -17,8 +20,24 @@
-
+ diff --git a/api-payroll/public/js/login.js b/api-payroll/public/js/login.js index 55b9d60..5d5deeb 100644 --- a/api-payroll/public/js/login.js +++ b/api-payroll/public/js/login.js @@ -16,13 +16,19 @@ console.log(getbaseUrl('html/')); dataType: 'json', data: parametros, success:function(data){ - console.log(JSON.stringify(data)) - - + console.log(JSON.stringify(data)); + if(data["status"] == "success"){ + console.log("yhi"); + }else if(data["status"] == "success" || (data["status"] === undefined)){ + $('#modalLoginError').modal('show'); + document.getElementById('modalLoginErrorBody').innerHTML = "The server didn't respond in time, please try again or refresh this page."; + } }, - error:function(x,e,h) { - console.log(x); - console.log(e + " " + h); + error:function(x) { + if (x.status==500){ + $('#modalLoginError').modal('show'); + document.getElementById('modalLoginErrorBody').innerHTML = "The user or password didnt match, please try again"; + } }, }); } \ No newline at end of file