Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. function login(){
  2.  
  3. usuario = $('#textDNI').val();
  4. clave = $('#passWeb').val();
  5.  
  6. if($('#textDNI').val() == ''){
  7. alert('Debe ingresar su DNI');
  8. return false;
  9. }
  10.  
  11. if($('#passWeb').val() == ''){
  12. alert('Debe ingresar su contraseña');
  13. return false;
  14. }else{
  15.  
  16. var urlEnvio = 'ruta de la API'
  17.  
  18. var elementos = [];
  19. axios.get(urlEnvio, {
  20. params: {
  21. user: usuario,
  22. pass: clave
  23. }
  24. })
  25. .then(response => {
  26. elementos = response.data;
  27. console.log(response.data);
  28. console.log(response.status)
  29. if (elementos.count == 0) {
  30. alert('No existe el usuario en el sistema');
  31. }else{
  32. window.location.href = 'panelUsuario.html';
  33. }
  34. });
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement