Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Front-NG
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
José Alejandro Cáceres López
Front-NG
Commits
d8528fcb
Commit
d8528fcb
authored
Aug 29, 2023
by
José Alejandro Cáceres López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pequeñas validaciones
parent
d5a4ae93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
30 deletions
+10
-30
auth.service.ts
src/app/core/auth/services/auth.service.ts
+2
-22
acta-compromiso-carreras.component.ts
...compromiso-carreras/acta-compromiso-carreras.component.ts
+2
-2
acta-consejo-departamento.component.ts
...nsejo-departamento/acta-consejo-departamento.component.ts
+2
-2
add-documentos.component.ts
... participacion/add-documentos/add-documentos.component.ts
+2
-2
datos-espe.service.ts
...n/services/APIs Externas/Datos espe/datos-espe.service.ts
+2
-2
No files found.
src/app/core/auth/services/auth.service.ts
View file @
d8528fcb
...
...
@@ -44,9 +44,7 @@ export class AuthService {
this
.
configureOauthService
();
// Establecer intervalo de renovación del token
const
refreshTokenInterval
=
setInterval
(()
=>
{
this
.
checkAndRefreshToken
();
},
300000
);
// 5 minutos en milisegundos
}
...
...
@@ -221,25 +219,7 @@ setGlobalUserProfiles(profiles: string[]) {
return
typeof
idToken
[
'sub'
]
!==
'undefined'
?
idToken
[
'sub'
].
toString
()
:
''
;
}
}
private
async
checkAndRefreshToken
()
{
const
accessTokenExpiration
=
this
.
oAuthService
.
getAccessTokenExpiration
();
const
currentTime
=
new
Date
().
getTime
();
// Renueva el token si está a punto de expirar en los próximos X segundos (por ejemplo, 300 segundos)
const
refreshThreshold
=
300
*
1000
;
// 300 segundos en milisegundos
if
(
accessTokenExpiration
-
currentTime
<
refreshThreshold
)
{
try
{
await
this
.
oAuthService
.
refreshToken
();
console
.
log
(
'Token renovado exitosamente.'
);
}
catch
(
error
)
{
console
.
error
(
'Error al renovar el token:'
,
error
);
}
}
}
}
function
ngOnDestroy
()
{
throw
new
Error
(
'Function not implemented.'
);
}
src/app/modules/main/pages/Proyectos/Acta de Compromiso de Carreras/acta-compromiso-carreras/acta-compromiso-carreras.component.ts
View file @
d8528fcb
...
...
@@ -69,7 +69,7 @@ export class ActaCompromisoCarrerasComponent implements OnInit {
if
(
fileList
.
length
>
0
)
{
this
.
file
=
fileList
[
0
];
if
(
!
this
.
validarArchivo
(
this
.
file
))
{
this
.
openModalError
(
'
Por favor, selecciona un archivo PDF
'
);
this
.
openModalError
(
'
Asegúrate de que el archivo sea un PDF, por favor.
'
);
return
;
}
else
{
this
.
archivoEsPDFValido
=
true
;
...
...
@@ -134,7 +134,7 @@ export class ActaCompromisoCarrerasComponent implements OnInit {
filename
:
response
.
fileName
};
}
catch
(
error
)
{
this
.
openModalError
(
'
Este PDF ya se ha subido
'
);
this
.
openModalError
(
'
La operación no se completó debido a que el archivo ya existe.
'
);
this
.
archivoEsPDFValido
=
false
;
return
{
idPDF
:
null
,
...
...
src/app/modules/main/pages/Proyectos/Acta de Consejo de Departamento/acta-consejo-departamento/acta-consejo-departamento.component.ts
View file @
d8528fcb
...
...
@@ -71,7 +71,7 @@ export class ActaConsejoDepartamentoComponent implements OnInit {
if
(
fileList
.
length
>
0
)
{
this
.
file
=
fileList
[
0
];
if
(
!
this
.
validarArchivo
(
this
.
file
))
{
this
.
openModalError
(
'
¡Por favor, selecciona un archivo PDF!
'
);
this
.
openModalError
(
'
Asegúrate de que el archivo sea un PDF, por favor.
'
);
this
.
archivoEsPDFValido
=
false
;
return
;
}
else
{
...
...
@@ -160,7 +160,7 @@ export class ActaConsejoDepartamentoComponent implements OnInit {
filename
:
response
.
fileName
};
}
catch
(
error
)
{
this
.
openModalError
(
'
Este PDF ya se ha subido
'
);
this
.
openModalError
(
'
La operación no se completó debido a que el archivo ya existe.
'
);
this
.
archivoEsPDFValido
=
false
;
return
{
idPDF
:
null
,
...
...
src/app/modules/main/pages/Proyectos/Inicio Ejecución/compromiso participacion/add-documentos/add-documentos.component.ts
View file @
d8528fcb
...
...
@@ -50,7 +50,7 @@ export class AddDocumentosComponent implements OnInit {
if
(
fileList
.
length
>
0
)
{
this
.
file
=
fileList
[
0
];
if
(
!
this
.
validarArchivo
(
this
.
file
))
{
this
.
openModalError
(
'
Seleccione Unicamente Archivos PDF
'
);
this
.
openModalError
(
'
Asegúrate de que el archivo sea un PDF, por favor.
'
);
}
else
{
this
.
archivoEsPDFValido
=
true
;
}
...
...
@@ -114,7 +114,7 @@ export class AddDocumentosComponent implements OnInit {
filename
:
response
.
fileName
};
}
catch
(
error
)
{
this
.
openModalError
(
'
Este PDF ya se ha subido
'
);
this
.
openModalError
(
'
La operación no se completó debido a que el archivo ya existe.
'
);
this
.
archivoEsPDFValido
=
false
;
return
{
idPDF
:
null
,
...
...
src/app/modules/main/services/APIs Externas/Datos espe/datos-espe.service.ts
View file @
d8528fcb
...
...
@@ -16,8 +16,8 @@ export class DatosEspeService {
private
idPDF
:
string
;
// Agregar una variable para almacenar el último ID guardado
private
fileName
:
string
;
// Agregar una variable para almacenar el último ID guardado
private
carrera
=
'https://api-ufa-test.espe.edu.ec/api/v1.0/private/academico/carreras'
private
getPDF
=
'https://api-ufa.espe.edu.ec/api/v1.0/private/files/getFile'
private
savePDF
=
'https://api-ufa.espe.edu.ec/api/v1.0/private/files/saveFile'
private
getPDF
=
'https://api-ufa
-test
.espe.edu.ec/api/v1.0/private/files/getFile'
private
savePDF
=
'https://api-ufa
-test
.espe.edu.ec/api/v1.0/private/files/saveFile'
private
getDepartamentos
=
'https://api-ufa-test.espe.edu.ec/api/v1.0/private/departamental/departamentos'
private
getCampus
=
'https://api-ufa-test.espe.edu.ec/api/v1.0/private/academico/campus'
private
apiUrl
=
'https://api-ufa-test.espe.edu.ec/api/v1.0/private/Docente/informacionServidorP'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment