sigesp 0.8.63-220120 → 0.8.64-220121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/sigesp.umd.js +33 -5
- package/bundles/sigesp.umd.js.map +1 -1
- package/bundles/sigesp.umd.min.js +1 -1
- package/bundles/sigesp.umd.min.js.map +1 -1
- package/esm2015/lib/sigesp.service.js +33 -6
- package/fesm2015/sigesp.js +32 -5
- package/fesm2015/sigesp.js.map +1 -1
- package/lib/sigesp.service.d.ts +17 -4
- package/package.json +1 -1
- package/sigesp.metadata.json +1 -1
package/fesm2015/sigesp.js
CHANGED
|
@@ -4232,6 +4232,7 @@ class SigespService {
|
|
|
4232
4232
|
this.usuarioActivo = null;
|
|
4233
4233
|
this.currentComponent = null;
|
|
4234
4234
|
this.userMenu = null;
|
|
4235
|
+
this.ip_adress = '127.0.0.1';
|
|
4235
4236
|
}
|
|
4236
4237
|
/**
|
|
4237
4238
|
* @description Valida que selo se escriban guiones y 9
|
|
@@ -5917,12 +5918,38 @@ class SigespService {
|
|
|
5917
5918
|
return false;
|
|
5918
5919
|
}
|
|
5919
5920
|
/**
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5921
|
+
* @description Obtiene el Ip del cliente
|
|
5922
|
+
* @return Json data
|
|
5923
|
+
* @author Ing. Wilmer Briceno
|
|
5924
|
+
*/
|
|
5924
5925
|
getIPAddress() {
|
|
5925
|
-
return this.http.get("http://api.ipify.org/?format=json")
|
|
5926
|
+
return this.http.get("http://api.ipify.org/?format=json")
|
|
5927
|
+
.pipe(catchError((err) => {
|
|
5928
|
+
console.log('error caught in service');
|
|
5929
|
+
console.error(err);
|
|
5930
|
+
sessionStorage.setItem('ip_adress', '127.0.0.1');
|
|
5931
|
+
//Handle the error here
|
|
5932
|
+
return throwError(err); //Rethrow it back to component
|
|
5933
|
+
}));
|
|
5934
|
+
}
|
|
5935
|
+
/**
|
|
5936
|
+
* @description Obtiene el Ip del cliente
|
|
5937
|
+
* @return Json data
|
|
5938
|
+
* @author Ing. Wilmer Briceno
|
|
5939
|
+
*/
|
|
5940
|
+
setIpAdress() {
|
|
5941
|
+
this.getIPAddress().subscribe((resp) => {
|
|
5942
|
+
sessionStorage.setItem('ip_adress', resp.ip);
|
|
5943
|
+
this.ip_adress = resp.ip;
|
|
5944
|
+
});
|
|
5945
|
+
}
|
|
5946
|
+
/**
|
|
5947
|
+
* @description Obtiene el Ip del cliente
|
|
5948
|
+
* @return Json data
|
|
5949
|
+
* @author Ing. Wilmer Briceno
|
|
5950
|
+
*/
|
|
5951
|
+
getIpAdress() {
|
|
5952
|
+
this.ip_adress = sessionStorage.getItem('ip_adress');
|
|
5926
5953
|
}
|
|
5927
5954
|
}
|
|
5928
5955
|
SigespService.ɵprov = ɵɵdefineInjectable({ factory: function SigespService_Factory() { return new SigespService(ɵɵinject(HttpClient), ɵɵinject(MatDialog), ɵɵinject(ToastrService)); }, token: SigespService, providedIn: "root" });
|