utn-cli 2.0.54 → 2.0.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.0.54",
3
+ "version": "2.0.56",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -10,6 +10,12 @@ const app = express();
10
10
  app.use(express.json());
11
11
  app.use(helmet());
12
12
  app.use(async (solicitud, respuesta, next) => {
13
+ let Usuario = null;
14
+ if (solicitud.headers.authorization) {
15
+ Usuario = await Miscelaneo.obtenerDatosDelUsuario(solicitud.headers.authorization) ?? null;
16
+ } else {
17
+ Usuario = solicitud.user ?? null;
18
+ }
13
19
  const safeReqData = {
14
20
  timestamp: new Date().toISOString(),
15
21
  httpVersion: solicitud.httpVersion,
@@ -30,7 +36,7 @@ app.use(async (solicitud, respuesta, next) => {
30
36
  cookies: solicitud.cookies,
31
37
  signedCookies: solicitud.signedCookies,
32
38
  userAgent: solicitud.get('User-Agent'),
33
- authUser: await Miscelaneo.obtenerDatosDelUsuario(solicitud.headers.authorization) ?? null,
39
+ authUser: Usuario,
34
40
  };
35
41
  try {
36
42
  const { ejecutarConsultaSIGU } = require('./servicios/Nucleo/db.js');
@@ -73,8 +73,8 @@ class Miscelaneo {
73
73
  ELSE 'PC'
74
74
  END AS Dispositivo
75
75
  FROM SIGU.SIGU_BitacoraDeSolicitudes
76
- WHERE JSON_VALUE(Solicitud, '$.authUser.uid') = ?
77
- AND JSON_VALUE(Solicitud, '$.originalUrl') NOT IN (?)
76
+ WHERE v_user_id = ?
77
+ AND v_original_url NOT IN (?)
78
78
  ORDER BY Consecutivo DESC
79
79
  LIMIT 100
80
80
  `, [decoded.uid, RUTAS_EXCLUIDAS]);
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, HttpHeaders } from '@angular/common/http';
2
2
  import { Component, OnInit, OnDestroy } from '@angular/core';
3
- import { RouterOutlet } from '@angular/router';
3
+ import { RouterOutlet, Router } from '@angular/router';
4
4
  import { DatosGlobalesService } from '../../../datos-globales.service';
5
5
  import { Location, CommonModule } from '@angular/common';
6
6
  import { MatIconModule } from '@angular/material/icon';
@@ -36,7 +36,7 @@ export class ContenedorComponentesComponent implements OnInit, OnDestroy {
36
36
  public AnimarUsuariosActivos: boolean = true;
37
37
  private intervaloUsuarios: any;
38
38
 
39
- constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService, private location: Location, private dialog: MatDialog) {
39
+ constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService, private location: Location, private dialog: MatDialog, private router: Router) {
40
40
  if (datosGlobalesService.ObtenerToken() === '') {
41
41
  datosGlobalesService.RedirigirALogin();
42
42
  }
@@ -213,8 +213,7 @@ export class ContenedorComponentesComponent implements OnInit, OnDestroy {
213
213
  }
214
214
 
215
215
  irAActividad(): void {
216
- const url = new URL(window.location.href);
217
- window.location.href = `${url.origin}/Actividad`;
216
+ this.router.navigate(['/Actividad']);
218
217
  }
219
218
 
220
219
  ngOnDestroy() {