bug fixed

This commit is contained in:
richard-loafle 2020-04-07 15:43:10 +09:00
parent 68099247c1
commit 85f56303e1
9 changed files with 39 additions and 44 deletions

6
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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);

View File

@ -50,7 +50,7 @@ export class AppAuthenticationResolver implements Resolve<void> {
): void | Observable<void> | Promise<void> {
return new Promise<void>(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

View File

@ -26,6 +26,7 @@
*ngIf="useRememberMe"
class="remember-me"
aria-label="Remember Me"
[checked]="!!userStore && userStore.rememberMe"
>
{{ 'login.labels.rememberMe' | ucapI18n }}
</mat-checkbox>
@ -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 }}
</mat-checkbox>

View File

@ -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<LoginTry>(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 {

View File

@ -29,7 +29,7 @@ export class AppAuthenticationService {
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {}
get userStore(): UserStore {
getUserStore(): UserStore {
const userStore = this.localStorageService.encGet<UserStore>(
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<UserStore>(
AppKey.UserStore,
{
@ -50,7 +50,7 @@ export class AppAuthenticationService {
);
}
get loginSession(): LoginSession {
getLoginSession(): LoginSession {
const loginSession = this.sessionStorageService.get<LoginSession>(
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<LoginSession>(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);
}
}
}

View File

@ -32,7 +32,7 @@ export class AppService {
initialize(): Promise<void[]> {
const initSession = new Promise<void>(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');

View File

@ -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,