@extends('layouts.baseacceso') @section('titulo', 'Iniciar sesion') @push('CSS') @endpush @section('contenido')
@endsection @push('JS') @endpush @push('JSOR') $("#frmAcceso").on("submit", function(e){ e.preventDefault(); cambiarEstadoBoton(true); $.ajax({ url: $(this).attr("action"), method: "POST", data: $(this).serialize(), success: function(response){ Swal.fire({ icon: "success", title: "¡Bienvenido!", text: "Acceso concedido correctamente", timer: 1500, showConfirmButton: false, timerProgressBar: true }).then(() => { window.location.href = response.redirect || "/dashboard"; }); }, error: function(xhr){ cambiarEstadoBoton(false); if (xhr.status === 422) { location.reload(); } else if (xhr.status === 401) { Swal.fire({ icon: "error", title: "Acceso denegado", text: "Las credenciales ingresadas son incorrectas", confirmButtonText: "Intentar de nuevo" }); } else { Swal.fire({ icon: "error", title: "Error del sistema", text: "Ocurrió un problema, intenta más tarde", confirmButtonText: "Aceptar" }); } } }); }); @endpush