add message for when user try to upload file with maliciose script

This commit is contained in:
Eudes Inácio
2024-03-11 10:24:24 +01:00
parent 8635ce2bae
commit 7e31bcf9d6
2 changed files with 14 additions and 1 deletions
+2
View File
@@ -232,6 +232,7 @@ export class AuthService {
window['e'] = e window['e'] = e
console.error('BeforesendAtachment', e) console.error('BeforesendAtachment', e)
message.uploadingFile = false message.uploadingFile = false
this.httpErroHandle.httpStatusHandleUploadFile(e);
return false return false
} }
@@ -252,6 +253,7 @@ export class AuthService {
window['e'] = e window['e'] = e
console.error('BeforesendAtachment', e) console.error('BeforesendAtachment', e)
message.uploadingFile = false message.uploadingFile = false
this.httpErroHandle.httpStatusHandleUploadFile(e);
return false return false
} }
} }
+12 -1
View File
@@ -50,13 +50,24 @@ export class HttpErrorHandle {
} }
} }
async httpStatusHandleUploadFile(error) {
switch (error.status
) {
case 403:
this.toastService._badRequest('O ficheiro que .')
break;
default:
break;
}
}
async loginHttpStatusHandle(error) { async loginHttpStatusHandle(error) {
switch (error.status switch (error.status
) { ) {
case 0: case 0:
const result = await this.backgroundService.offline() const result = await this.backgroundService.offline()
if (result) { if (result) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') this.toastService._badRequest('O ficheiro que tentou enviar contém possível script malicioso')
} else { } else {
} }