From 0a3e8a9df0868d1e884be4386042d573a0649959 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 16 Dec 2019 09:58:01 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EB=8F=99=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20/=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/guards/auto-login.guard.ts | 14 +++++++++++--- .../messenger/components/left-side.component.html | 2 +- .../messenger/components/left-side.component.ts | 8 ++++++++ .../account/components/login.page.component.ts | 2 +- .../src/app/services/authentication.service.ts | 11 ++++++++++- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/guards/auto-login.guard.ts b/projects/ucap-webmessenger-app/src/app/guards/auto-login.guard.ts index 6f91e389..d14cf7a6 100644 --- a/projects/ucap-webmessenger-app/src/app/guards/auto-login.guard.ts +++ b/projects/ucap-webmessenger-app/src/app/guards/auto-login.guard.ts @@ -9,7 +9,10 @@ import { import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; -import { LocalStorageService } from '@ucap-webmessenger/web-storage'; +import { + LocalStorageService, + SessionStorageService +} from '@ucap-webmessenger/web-storage'; import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type'; import { environment } from '../../environments/environment'; import * as AuthenticationStore from '@app/store/account/authentication'; @@ -21,7 +24,8 @@ export class AppAutoLoginGuard implements CanActivate { constructor( private router: Router, private store: Store, - private localStorageService: LocalStorageService + private localStorageService: LocalStorageService, + private sessionStorageService: SessionStorageService ) {} canActivate( @@ -38,7 +42,11 @@ export class AppAutoLoginGuard implements CanActivate { environment.customConfig.appKey ); - if (!!appUserInfo && appUserInfo.autoLogin) { + const personLogout: boolean = this.sessionStorageService.get( + 'PERSON_LOGOUT' + ); + + if (!!appUserInfo && appUserInfo.autoLogin && !personLogout) { this.store.dispatch( AuthenticationStore.webLogin({ loginInfo: { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html index 247261f0..aca892bc 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html @@ -150,7 +150,7 @@ diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts index 080c8b8a..313a189c 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts @@ -437,4 +437,12 @@ export class LeftSideComponent implements OnInit, OnDestroy { ) .subscribe(); } + + getMyProfileImageWidget(): string { + if (!!this.loginRes) { + return this.loginRes.userInfo.profileImageFile; + } else { + return ''; + } + } } diff --git a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts index 4f47cdc5..9b04c3e9 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts @@ -74,7 +74,7 @@ export class LoginPageComponent implements OnInit, OnDestroy { this.store.dispatch( CompanyStore.companyList({ - companyGroupCode: 'LG' + companyGroupCode: environment.companyConfig.companyGroupCode }) ); diff --git a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts index a5678c91..f763d153 100644 --- a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts @@ -9,7 +9,8 @@ import { LoginInfo, KEY_LOGIN_INFO, KEY_LOGIN_RES_INFO, - KEY_VER_INFO + KEY_VER_INFO, + KEY_URL_INFO } from '../types'; import { PasswordUtil } from '@ucap-webmessenger/pi'; import { DaesangCipherService } from '@ucap-webmessenger/daesang'; @@ -64,6 +65,9 @@ export class AppAuthenticationService { if (rememberMe || autoLogin) { appUserInfo = { ...appUserInfo, + companyGroupType: loginInfo.companyGroupType, + companyCode: loginInfo.companyCode, + loginId: loginInfo.loginId, loginPw: autoLogin ? loginInfo.loginPw : undefined, rememberMe, autoLogin @@ -75,11 +79,16 @@ export class AppAuthenticationService { appUserInfo, environment.customConfig.appKey ); + + this.sessionStorageService.remove('PERSON_LOGOUT'); } logout() { this.sessionStorageService.remove(KEY_LOGIN_RES_INFO); this.sessionStorageService.remove(KEY_VER_INFO); this.sessionStorageService.remove(KEY_LOGIN_INFO); + this.sessionStorageService.remove(KEY_URL_INFO); + + this.sessionStorageService.set('PERSON_LOGOUT', true); } }