JeanBenitez 3 年之前
父节点
当前提交
7f6c535fa7

+ 5 - 19
vacaciones/src/app/components/mes/mesmre/mesmre.component.ts

@@ -107,16 +107,10 @@ export class MESMREComponent implements AfterViewInit {
       localStorage.getItem('TIMUSERENC')!
     );
     this.nombre_usuario = usuario.NOMBRE;
-
-    if (
-      this._encService.desencriptar(JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL) === '1'
-    ) {
+      
+    if (this._encService.desencriptar(JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL) === '1') {
       this.role = 'Administrador';
-    } else if (
-      this._encService.desencriptar(
-        JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL
-      ) !== '1'
-    ) {
+    } else if (this._encService.desencriptar(JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL) !== '1') {
       this.opcionesSolicitudes = this.opcionesSolicitudes.slice(0, 1);
       this.isUser = true;
       this.role = 'Usuario';
@@ -168,11 +162,7 @@ export class MESMREComponent implements AfterViewInit {
   }
 
   async obtenerEmpleados() {
-    if (
-      this._encService.desencriptar(
-        JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL
-      ) === '1'
-    ) {
+    if (this._encService.desencriptar(JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL) === '1') {
       await lastValueFrom(this.__mesmreService.consultarTodos()).then(
         (res: any) => {
           if (res.error) {
@@ -210,11 +200,7 @@ export class MESMREComponent implements AfterViewInit {
             )
           )
       );
-    } else if (
-      this._encService.desencriptar(
-        JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL
-      ) !== '1'
-    ) {
+    } else if (this._encService.desencriptar(JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL) !== '1') {
       await lastValueFrom(this.__mesmreService.consultarEmpleados()).then(
         (res: any) => {
           if (res.error) {

+ 1 - 5
vacaciones/src/app/services/mes/mesmre/mesmre.service.ts

@@ -61,11 +61,7 @@ export class MESMREService {
 
   consultarEmpleados(): any {
     return this.http.get<ResponseData>(
-      `${
-        this._url_empleados
-      }/consultar/empleados/${this._encService.desencriptar(
-        this.usuario_session.IDUSUARIO
-      )}/${this.formatoRFC(this.usuario_session.RFCEMPRESA)}}`,
+      `${this._url_empleados}/consultar/empleados/${this._encService.desencriptar(this.usuario_session.IDUSUARIO)}/${this.formatoRFC(this.usuario_session.RFCEMPRESA)}}`,
       { headers: this.header }
     ).pipe(map(data => data));
   }