devportal
Last change
on this file was
0155753,
checked in by Argenis Osorio <argenisosorio580@…>, 9 months ago
|
Agregados archivos restantes al seguimiento de git
|
-
Property mode set to
100755
|
File size:
1.3 KB
|
Rev | Line | |
---|
[bbe2084] | 1 | /** |
---|
[157ce67] | 2 | * Función que se conecta al servicio web de verificación de la firma |
---|
| 3 | * electrónica captura el evento submit y toma el formulario para enviar el |
---|
| 4 | * servicio web. |
---|
[bbe2084] | 5 | */ |
---|
| 6 | |
---|
| 7 | $(function() { |
---|
| 8 | $("#verificar").on("submit", function(e){ |
---|
| 9 | e.preventDefault(); |
---|
| 10 | var f = $(this); |
---|
| 11 | var formData = new FormData(); |
---|
| 12 | formData.append("upload", $("#file-check-sign")[0].files[0]); |
---|
| 13 | $.ajax({ |
---|
| 14 | url: "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/firmados", |
---|
| 15 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
| 16 | type: "post", |
---|
| 17 | dataType: "json", |
---|
| 18 | data: formData, |
---|
| 19 | cache: false, |
---|
| 20 | contentType: false, |
---|
| 21 | xhrFields: { withCredentials: true }, |
---|
| 22 | processData: false, |
---|
| 23 | success: function(response) { |
---|
| 24 | var tempJson = JSON.stringify(response); |
---|
| 25 | var jsonparsed = JSON.parse(tempJson); |
---|
| 26 | var fileType = jsonparsed['mimeType']; |
---|
| 27 | var html; |
---|
| 28 | if (fileType == 'application/pdf') { |
---|
| 29 | html = manejoJsonPDF(JSON.stringify(response)); |
---|
| 30 | } else { |
---|
| 31 | html = manejoJsonBDOC(JSON.stringify(response)); |
---|
| 32 | } |
---|
| 33 | document.getElementById("respuestaVerificacion").innerHTML = html; |
---|
| 34 | }, |
---|
| 35 | error: function(response) { |
---|
| 36 | //Que se ejecuta cuando finalice la petición de con error |
---|
[0320f1b] | 37 | $("#respuestaVerificacion").html('¡Error!' + response); |
---|
[bbe2084] | 38 | } |
---|
| 39 | }); |
---|
| 40 | }); |
---|
| 41 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.