Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login(){
- usuario = $('#textDNI').val();
- clave = $('#passWeb').val();
- if($('#textDNI').val() == ''){
- alert('Debe ingresar su DNI');
- return false;
- }
- if($('#passWeb').val() == ''){
- alert('Debe ingresar su contraseña');
- return false;
- }else{
- var urlEnvio = 'ruta de la API'
- var elementos = [];
- axios.get(urlEnvio, {
- params: {
- user: usuario,
- pass: clave
- }
- })
- .then(response => {
- elementos = response.data;
- console.log(response.data);
- console.log(response.status)
- if (elementos.count == 0) {
- alert('No existe el usuario en el sistema');
- }else{
- window.location.href = 'panelUsuario.html';
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement