refactoring

This commit is contained in:
leejinho 2019-12-17 13:00:33 +09:00
parent fcfb03e9f9
commit d5bdbd2cd7
4 changed files with 34 additions and 10 deletions

View File

@ -7,6 +7,7 @@
<div *ngIf="!!loginRes" class="app-layout-native-title-bar-link"> <div *ngIf="!!loginRes" class="app-layout-native-title-bar-link">
<button <button
mat-icon-button mat-icon-button
*ngIf="weblink.length > 0"
class="button app-layout-native-title-bar-logout" class="button app-layout-native-title-bar-logout"
matTooltip="웹링크" matTooltip="웹링크"
(click)="onToggleWebLinkSelector()" (click)="onToggleWebLinkSelector()"

View File

@ -46,7 +46,6 @@ export class TopBarComponent implements OnInit, OnDestroy {
loginRes: LoginResponse; loginRes: LoginResponse;
loginResSubscription: Subscription; loginResSubscription: Subscription;
appUserInfo: AppUserInfo;
updateInfo$: Observable<UpdateInfo>; updateInfo$: Observable<UpdateInfo>;
@ -62,12 +61,7 @@ export class TopBarComponent implements OnInit, OnDestroy {
private localStorageService: LocalStorageService, private localStorageService: LocalStorageService,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private daesangApiService: DaesangApiService private daesangApiService: DaesangApiService
) { ) {}
this.appUserInfo = this.localStorageService.encGet<AppUserInfo>(
KEY_APP_USER_INFO,
environment.customConfig.appKey
);
}
ngOnInit() { ngOnInit() {
this.windowStateChanged$ = this.nativeService.windowStateChanged(); this.windowStateChanged$ = this.nativeService.windowStateChanged();
@ -127,8 +121,13 @@ export class TopBarComponent implements OnInit, OnDestroy {
weblink => weblink.key === 'WebLinkMailCnt' weblink => weblink.key === 'WebLinkMailCnt'
); );
if (link.length > 0) { if (link.length > 0) {
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
KEY_APP_USER_INFO,
environment.customConfig.appKey
);
const WebLinkMailCnt = link[0]; const WebLinkMailCnt = link[0];
const loginPw = this.appUserInfo.loginPw; const loginPw = appUserInfo.loginPw;
const loginPw2 = this.loginInfo.loginPw; const loginPw2 = this.loginInfo.loginPw;
const loginId = this.loginInfo.loginId; const loginId = this.loginInfo.loginId;
const token = loginRes.tokenString; const token = loginRes.tokenString;
@ -157,9 +156,14 @@ export class TopBarComponent implements OnInit, OnDestroy {
weblink => weblink.key === 'WebLinkPaymentCnt' weblink => weblink.key === 'WebLinkPaymentCnt'
); );
if (link.length > 0) { if (link.length > 0) {
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
KEY_APP_USER_INFO,
environment.customConfig.appKey
);
const WebLinkPaymentCnt = link[0]; const WebLinkPaymentCnt = link[0];
const WebLinkMailCnt = link[0]; const WebLinkMailCnt = link[0];
const loginPw = this.appUserInfo.loginPw; const loginPw = appUserInfo.loginPw;
const loginPw2 = this.loginInfo.loginPw; const loginPw2 = this.loginInfo.loginPw;
const loginId = this.loginInfo.loginId; const loginId = this.loginInfo.loginId;
const token = loginRes.tokenString; const token = loginRes.tokenString;
@ -222,7 +226,12 @@ export class TopBarComponent implements OnInit, OnDestroy {
this.showWeblink = !this.showWeblink; this.showWeblink = !this.showWeblink;
} }
onClickWebLink(link: WebLink): void { onClickWebLink(link: WebLink): void {
const loginPw = this.appUserInfo.loginPw; const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
KEY_APP_USER_INFO,
environment.customConfig.appKey
);
const loginPw = appUserInfo.loginPw;
const loginPw2 = this.loginInfo.loginPw; const loginPw2 = this.loginInfo.loginPw;
const loginId = this.loginInfo.loginId; const loginId = this.loginInfo.loginId;
const token = this.loginRes.tokenString; const token = this.loginRes.tokenString;

View File

@ -52,6 +52,13 @@ export const environment: Environment = {
} }
}, },
customConfig: {
appKey: '!@#$DAESANG%^&*',
/** 삭제,수정 불가 그룹 Seqs:number[] */
fixedGroupSeqs: []
},
commonApiModuleConfig: { commonApiModuleConfig: {
hostConfig: { hostConfig: {
protocol: 'http', protocol: 'http',

View File

@ -52,6 +52,13 @@ export const environment: Environment = {
} }
}, },
customConfig: {
appKey: '!@#$DAESANG%^&*',
/** 삭제,수정 불가 그룹 Seqs:number[] */
fixedGroupSeqs: []
},
commonApiModuleConfig: { commonApiModuleConfig: {
hostConfig: { hostConfig: {
protocol: 'http', protocol: 'http',