[대상향 ]비밀번호 변경페이지 변경

This commit is contained in:
leejinho 2019-12-19 08:49:06 +09:00
parent 760b098fc4
commit 93c7991e20
2 changed files with 31 additions and 4 deletions

View File

@ -53,7 +53,10 @@ import {
import { AppAuthenticationService } from '@app/services/authentication.service';
import { NGXLogger } from 'ngx-logger';
import { Store } from '@ngrx/store';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import {
SessionStorageService,
LocalStorageService
} from '@ucap-webmessenger/web-storage';
import {
AuthenticationProtocolService,
@ -73,6 +76,8 @@ import {
UserPasswordSetResponse
} from '@ucap-webmessenger/protocol-service';
import { DaesangUrlInfoResponse } from '@ucap-webmessenger/api-external';
import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type';
import { DaesangCipherService } from '@ucap-webmessenger/daesang';
@Injectable()
export class Effects {
@ -309,7 +314,21 @@ export class Effects {
weblink => weblink.key === 'WebLinkChgPassword'
);
if (passwordChangeUrl.length > 0) {
this.nativeService.openDefaultBrowser(passwordChangeUrl[0].url);
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
KEY_APP_USER_INFO,
environment.customConfig.appKey
);
const loginPw = appUserInfo.loginPw;
const loginId = appUserInfo.loginId;
const url = passwordChangeUrl[0].url
.replace(/(\(%USER_ID%\))/g, loginId)
.replace(
/(\(%USER_PASS%\))/g,
this.daesangCipherService.encryptForWebLink(loginPw)
);
this.nativeService.openDefaultBrowser(url);
}
this.store.dispatch(logout());
@ -455,6 +474,7 @@ export class Effects {
private ngZone: NgZone,
private router: Router,
private store: Store<any>,
private localStorageService: LocalStorageService,
private sessionStorageService: SessionStorageService,
private piService: PiService,
private appAuthenticationService: AppAuthenticationService,
@ -464,6 +484,7 @@ export class Effects {
private dialogService: DialogService,
private snackBarService: SnackBarService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private logger: NGXLogger
private logger: NGXLogger,
private daesangCipherService: DaesangCipherService
) {}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import CryptoJS from 'crypto-js';
import crypto from 'crypto';
import { CipherUtil } from '../utils/CipherUtil';
@ -34,4 +34,10 @@ export class DaesangCipherService {
return cipherChunks.join('');
}
encryptForWebLink(pvSource: string): string {
return CryptoJS.SHA1(pvSource)
.toString()
.toUpperCase();
}
}