From 85f56303e1e02788cf4bc3edadbadd64289cf942 Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Tue, 7 Apr 2020 15:43:10 +0900 Subject: [PATCH] bug fixed --- package-lock.json | 6 ++-- package.json | 2 +- src/app/guards/app-authentication.guard.ts | 4 +-- .../resolvers/app-authentication.resolver.ts | 2 +- .../components/login.section.component.html | 7 +++++ .../components/login.section.component.ts | 15 +--------- .../services/app-authentication.service.ts | 30 +++++++++---------- src/app/services/app.service.ts | 6 ++-- src/assets/scss/global/_default.scss | 11 +++---- 9 files changed, 39 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3bf56f7..88674e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1951,9 +1951,9 @@ "integrity": "sha512-U/tpzUgXSGrWzetmmqEcLYYzgCUEew3C0CcfYSr+ajkt4AvHqcFijqXARVHXVahfAkMXZU69/8etDhzWmOcvGw==" }, "@ucap/ng-ui-authentication": { - "version": "0.0.14", - "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-ui-authentication/-/ng-ui-authentication-0.0.14.tgz", - "integrity": "sha512-wejkhebthEUub9nGigu9/fENB7hwOHrYTDq4dPmitxKeb3o1RNdbjAzaEB0QlVmLF+/ReydWZqr2d4d8Dus+/g==" + "version": "0.0.15", + "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-ui-authentication/-/ng-ui-authentication-0.0.15.tgz", + "integrity": "sha512-RDDubvBs14kL5yiISq34lPWDMGCitcwmWR3QFYF1gv2X3xEyqzr8Cg35GWIuhyyaSDIx69sG+mn+IYKBarJwlA==" }, "@ucap/ng-ui-organization": { "version": "0.0.2", diff --git a/package.json b/package.json index f7d0ced..723b1fb 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@ucap/ng-web-storage": "~0.0.3", "@ucap/ng-ui": "~0.0.3", "@ucap/ng-ui-organization": "~0.0.2", - "@ucap/ng-ui-authentication": "~0.0.14", + "@ucap/ng-ui-authentication": "~0.0.15", "@ucap/ng-ui-skin-default": "~0.0.1", "@ucap/pi": "~0.0.5", "@ucap/protocol": "~0.0.8", diff --git a/src/app/guards/app-authentication.guard.ts b/src/app/guards/app-authentication.guard.ts index 26f5eb7..bc42c49 100644 --- a/src/app/guards/app-authentication.guard.ts +++ b/src/app/guards/app-authentication.guard.ts @@ -43,11 +43,11 @@ export class AppAuthenticationGuard implements CanActivate { } else { const userStore = this.appAuthenticationService.useAutoLogin(); if (!!userStore) { - const loginSession = this.appAuthenticationService.loginSession; + const loginSession = this.appAuthenticationService.getLoginSession(); const onWebLoginFailure = (error: any) => { userStore.settings.general.autoLogin = false; - this.appAuthenticationService.userStore = userStore; + this.appAuthenticationService.setUserStore(userStore); this.router.navigateByUrl('/account/login'); resolve(false); diff --git a/src/app/resolvers/app-authentication.resolver.ts b/src/app/resolvers/app-authentication.resolver.ts index 8be895e..3e3b15c 100644 --- a/src/app/resolvers/app-authentication.resolver.ts +++ b/src/app/resolvers/app-authentication.resolver.ts @@ -50,7 +50,7 @@ export class AppAuthenticationResolver implements Resolve { ): void | Observable | Promise { return new Promise(async (resolve, reject) => { try { - const loginSession = this.appAuthenticationService.loginSession; + const loginSession = this.appAuthenticationService.getLoginSession(); const networkInfo = await this.nativeService.getNetworkInfo(); const localIp = !!networkInfo && 0 < networkInfo.length && !!networkInfo[0].ip diff --git a/src/app/sections/account/components/login.section.component.html b/src/app/sections/account/components/login.section.component.html index 35932b9..8ec99a7 100644 --- a/src/app/sections/account/components/login.section.component.html +++ b/src/app/sections/account/components/login.section.component.html @@ -26,6 +26,7 @@ *ngIf="useRememberMe" class="remember-me" aria-label="Remember Me" + [checked]="!!userStore && userStore.rememberMe" > {{ 'login.labels.rememberMe' | ucapI18n }} @@ -35,6 +36,12 @@ *ngIf="useAutoLogin" class="auto-login" aria-label="Auto Login" + [checked]=" + !!userStore && + !!userStore.settings && + !!userStore.settings.general && + userStore.settings.general.autoLogin + " > {{ 'login.labels.autoLogin' | ucapI18n }} diff --git a/src/app/sections/account/components/login.section.component.ts b/src/app/sections/account/components/login.section.component.ts index ebcc015..0f1d752 100644 --- a/src/app/sections/account/components/login.section.component.ts +++ b/src/app/sections/account/components/login.section.component.ts @@ -70,7 +70,7 @@ export class LoginSectionComponent implements OnInit, OnDestroy { ) {} ngOnInit(): void { - this.loginSession = this.appAuthenticationService.loginSession; + this.loginSession = this.appAuthenticationService.getLoginSession(); this.loginTry = this.sessionStorageService.get(AppKey.LoginTry); @@ -93,19 +93,6 @@ export class LoginSectionComponent implements OnInit, OnDestroy { .subscribe((param) => { this.loginTry = param.value as LoginTry; }); - - if (!!this.userStore && this.userStore.rememberMe) { - this.chkUseRememberMe.checked = true; - } - - if ( - !!this.userStore && - !!this.userStore.settings && - !!this.userStore.settings.general && - this.userStore.settings.general.autoLogin - ) { - this.chkUseAutoLogin.checked = true; - } } ngOnDestroy(): void { diff --git a/src/app/services/app-authentication.service.ts b/src/app/services/app-authentication.service.ts index ef480d0..5cf365c 100644 --- a/src/app/services/app-authentication.service.ts +++ b/src/app/services/app-authentication.service.ts @@ -29,7 +29,7 @@ export class AppAuthenticationService { @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService ) {} - get userStore(): UserStore { + getUserStore(): UserStore { const userStore = this.localStorageService.encGet( AppKey.UserStore, environment.productConfig.localEncriptionKey @@ -38,8 +38,8 @@ export class AppAuthenticationService { return userStore; } - set userStore(userStore: UserStore) { - const oldUserStore = this.userStore; + setUserStore(userStore: UserStore) { + const oldUserStore = this.getUserStore(); this.localStorageService.encSet( AppKey.UserStore, { @@ -50,7 +50,7 @@ export class AppAuthenticationService { ); } - get loginSession(): LoginSession { + getLoginSession(): LoginSession { const loginSession = this.sessionStorageService.get( AppKey.LoginSession ); @@ -58,8 +58,8 @@ export class AppAuthenticationService { return loginSession; } - set loginSession(loginSession: LoginSession) { - const oldLoginSession = this.loginSession; + setLoginSession(loginSession: LoginSession) { + const oldLoginSession = this.getLoginSession(); this.sessionStorageService.set(AppKey.LoginSession, { ...oldLoginSession, ...loginSession @@ -67,12 +67,12 @@ export class AppAuthenticationService { } loggedIn(): boolean { - const loginSession = this.loginSession; + const loginSession = this.getLoginSession(); return !!loginSession && !!loginSession.loginId; } useAutoLogin(): UserStore | null { - const userStore = this.userStore; + const userStore = this.getUserStore(); return !!userStore && !!userStore.settings && @@ -87,7 +87,7 @@ export class AppAuthenticationService { rememberMe: boolean, autoLogin: boolean ) { - const prevLoginSession = this.loginSession; + const prevLoginSession = this.getLoginSession(); const newLoginSession = { ...prevLoginSession, @@ -96,13 +96,13 @@ export class AppAuthenticationService { }; const encLoginPw = PasswordUtil.encrypt(newLoginSession.loginPw); - this.loginSession = { + this.setLoginSession({ ...newLoginSession, initPw: newLoginSession.loginId === newLoginSession.loginPw, loginPw: encLoginPw - }; + }); - let userStore = this.userStore; + let userStore = this.getUserStore(); if (!userStore) { userStore = { @@ -142,7 +142,7 @@ export class AppAuthenticationService { userStore.settings.general.autoLogin = autoLogin; } - this.userStore = userStore; + this.setUserStore(userStore); this.sessionStorageService.remove(AppKey.LogoutSession); } @@ -154,7 +154,7 @@ export class AppAuthenticationService { this.sessionStorageService.remove(AppKey.UrlInfoResponse); this.sessionStorageService.remove(AppKey.AuthResponse); - let userStore = this.userStore; + let userStore = this.getUserStore(); if (!!userStore) { userStore = { @@ -168,7 +168,7 @@ export class AppAuthenticationService { } }; - this.userStore = userStore; + this.setUserStore(userStore); } } } diff --git a/src/app/services/app.service.ts b/src/app/services/app.service.ts index 47c084b..ca4cecc 100644 --- a/src/app/services/app.service.ts +++ b/src/app/services/app.service.ts @@ -32,7 +32,7 @@ export class AppService { initialize(): Promise { const initSession = new Promise(async (resolve, reject) => { try { - let loginSession = this.appAuthenticationService.loginSession; + let loginSession = this.appAuthenticationService.getLoginSession(); loginSession = loginSession || {}; @@ -64,12 +64,12 @@ export class AppService { break; } - this.appAuthenticationService.loginSession = { + this.appAuthenticationService.setLoginSession({ ...loginSession, deviceType, desktopType, companyGroupCode: this.companyGroupCode - }; + }); this.dateService.setDefaultTimezone('Asia/Seoul'); this.dateService.use('Asia/Seoul'); diff --git a/src/assets/scss/global/_default.scss b/src/assets/scss/global/_default.scss index af4891f..0b05a7e 100644 --- a/src/assets/scss/global/_default.scss +++ b/src/assets/scss/global/_default.scss @@ -1,6 +1,6 @@ @charset 'utf-8'; -$win-min-w: 700px; -$win-min-h: 600px; +$win-min-w: 420px; +$win-min-h: 640px; html { height: 100%; overflow: hidden; @@ -11,9 +11,9 @@ body { height: 100%; /*min-width: 1160px; min-height: 800px;*/ - min-width: $win-min-w; - min-height: $win-min-h; - overflow: auto; + min-width: $win-min-w !important; + min-height: $win-min-h !important; + overflow: hidden; padding: 0; margin: 0; color: #333; @@ -25,6 +25,7 @@ body { -moz-box-sizing: border-box; box-sizing: border-box; } + div, p, ol,