diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 608058aa6..6da82e2b8 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -1,9 +1,18 @@
- + +
+
+
+
+ +
+
+
+

Inicie a sessão

Nome de utilizador

diff --git a/src/app/pages/login/login.page.scss b/src/app/pages/login/login.page.scss index 6ebe5b4de..a5fc0de1a 100644 --- a/src/app/pages/login/login.page.scss +++ b/src/app/pages/login/login.page.scss @@ -23,10 +23,55 @@ ion-content{ margin: auto !important; overflow: auto; } +.logo{ + width: 400px; + height: 400px; + background-image: url("/assets/background/auth.svg"); + background-position: center; + background-repeat: no-repeat; +} +.bg-1{ + width: 250px; + height: 250px; + overflow: auto; + border-radius: 50%; + background: #4cb9f825; + margin: auto; + .bg-2{ + width: 225px; + height: 225px; + overflow: auto; + border-radius: 50%; + background: #61bdf2b4; + margin: auto; + .bg-3{ + width: 200px; + height: 200px; + overflow: auto; + border-radius: 50%; + background: #96d3f8be; + margin: auto; + .bg-4{ + width: 175px; + height: 175px; + overflow: auto; + border-radius: 50%; + background: rgba(255, 255, 255, 0.918); + padding: 15px; + margin: auto; + + .bg-4 img{ + width: 100%; + } + } + } + } +} .div-logo{ - width: 200px; + width: 200px !important; margin: 0 auto; padding-bottom: 15px; + } .div-logo img{ width: 100%; @@ -71,7 +116,7 @@ ion-item{ border: 0!important; } -.div-logo { +/* .div-logo { background: transparent; width: em(140px); justify-content: center; @@ -80,7 +125,7 @@ ion-item{ .div-logo img{ width: 100%; margin: 0px auto; -} +} */ @@ -141,10 +186,11 @@ ion-item{ align-items: center; justify-content: center; background-image: url("/assets/background/auth.svg"); - background-size: 686px 674px; + background-size: 596px 584px; background-position: center; - background-position-y: 78px; + background-position-y: 160px; background-repeat: no-repeat; + margin: auto; } .voltar{ diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 09900f0f1..a98f685f2 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -118,7 +118,10 @@ export class LoginPage implements OnInit { domainName: environment.domain, BasicAuthKey: "" } - if (await this.authService.login(this.userattempt)) { + let attempt = await this.authService.login(this.userattempt); + console.log(JSON.stringify(attempt)); + + if (attempt) { //this.loginRocketChat(); this.authService.loginChat(this.userattempt); //this.getToken(); @@ -132,7 +135,7 @@ export class LoginPage implements OnInit { } else { - this.toastService.badRequest('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar'); + this.toastService.badRequest('O nome de utilizador e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar'); } } else{ diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 1585007f6..922b85145 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -51,29 +51,35 @@ export class AuthService { } const service = environment.apiURL + "userauthentication/GetValidateAuth"; - let result: boolean | PromiseLike; + let result: boolean | PromiseLike = false; let response: any; - result = await this.http.get(service, options).toPromise(); - response = await this.http.post(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise(); + try { + result = await this.http.get(service, options).toPromise(); + response = await this.http.post(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise(); - console.log(response) + console.log(response); - if (result) { + if (result) { + if( response.RoleID == 100000014) { + response.Profile = 'PR' + } else if(response.RoleID == 100000011) { + response.Profile = 'MDGPR' + } + response.BasicAuthKey = user.BasicAuthKey + this.ValidatedUser = response; - if( response.RoleID == 100000014) { - response.Profile = 'PR' - } else if(response.RoleID == 100000011) { - response.Profile = 'MDGPR' + localStorage.setItem('user', JSON.stringify(response)); + + this.storageService.store(AuthConnstants.USER, response); + + return result; } - response.BasicAuthKey = user.BasicAuthKey - this.ValidatedUser = response; - - localStorage.setItem('user', JSON.stringify(response)); - - this.storageService.store(AuthConnstants.USER, response); + + } catch (error) { + return result; } - return result; + } logout(){