bug fixed

This commit is contained in:
병준 박 2019-11-29 16:08:24 +09:00
parent 2d99b7c4c8
commit 4da93a5351
7 changed files with 113 additions and 60 deletions

View File

@ -69,7 +69,7 @@ export class LoginPageComponent implements OnInit, OnDestroy {
>(AlertDialogComponent, { >(AlertDialogComponent, {
width: '360px', width: '360px',
data: { data: {
title: 'Alert', title: '로그인',
html: `아이디 또는 패스워드가<br/>일치하지 않습니다.` html: `아이디 또는 패스워드가<br/>일치하지 않습니다.`
} }
}); });
@ -83,7 +83,7 @@ export class LoginPageComponent implements OnInit, OnDestroy {
>(AlertDialogComponent, { >(AlertDialogComponent, {
width: '360px', width: '360px',
data: { data: {
title: 'Alert', title: '로그인',
html: `비밀번호 오류 횟수 초과입니다.<br/>비밀번호를 확인하신 후<br/>잠시 후 다시 시작해 주세요.` html: `비밀번호 오류 횟수 초과입니다.<br/>비밀번호를 확인하신 후<br/>잠시 후 다시 시작해 주세요.`
} }
}); });

View File

@ -16,7 +16,7 @@ import {
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { ProtocolService } from '@ucap-webmessenger/protocol'; import { ProtocolService, ServerErrorCode } from '@ucap-webmessenger/protocol';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { import {
PublicApiService, PublicApiService,
@ -51,6 +51,7 @@ import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { environment } from '../../environments/environment'; import { environment } from '../../environments/environment';
import { SnackBarService } from '@ucap-webmessenger/ui';
@Injectable() @Injectable()
export class AppMessengerResolver implements Resolve<void> { export class AppMessengerResolver implements Resolve<void> {
@ -63,6 +64,7 @@ export class AppMessengerResolver implements Resolve<void> {
private optionProtocolService: OptionProtocolService, private optionProtocolService: OptionProtocolService,
private authenticationProtocolService: AuthenticationProtocolService, private authenticationProtocolService: AuthenticationProtocolService,
private innerProtocolService: InnerProtocolService, private innerProtocolService: InnerProtocolService,
private snackBarService: SnackBarService,
private logger: NGXLogger private logger: NGXLogger
) {} ) {}
@ -101,7 +103,8 @@ export class AppMessengerResolver implements Resolve<void> {
}), }),
switchMap(() => this.innerProtocolService.conn({})), switchMap(() => this.innerProtocolService.conn({})),
switchMap(res => { switchMap(res => {
return this.authenticationProtocolService.login({ return this.authenticationProtocolService
.login({
loginId: loginInfo.loginId, loginId: loginInfo.loginId,
loginPw: loginInfo.loginPw, loginPw: loginInfo.loginPw,
deviceType: environmentsInfo.deviceType, deviceType: environmentsInfo.deviceType,
@ -119,7 +122,19 @@ export class AppMessengerResolver implements Resolve<void> {
userSpecificInformation: 'PRO_000482', userSpecificInformation: 'PRO_000482',
productId: environment.productConfig.productId, productId: environment.productConfig.productId,
productName: environment.productConfig.productName productName: environment.productConfig.productName
}); })
.pipe(
catchError(err => {
switch (err as ServerErrorCode) {
case ServerErrorCode.ERRCD_IDPW:
break;
default:
break;
}
return throwError(err);
})
);
}), }),
switchMap(res => { switchMap(res => {
loginRes = res; loginRes = res;

View File

@ -17,7 +17,10 @@ import {
ConfirmDialogComponent, ConfirmDialogComponent,
ConfirmDialogData, ConfirmDialogData,
ConfirmDialogResult, ConfirmDialogResult,
SnackBarService SnackBarService,
AlertDialogComponent,
AlertDialogData,
AlertDialogResult
} from '@ucap-webmessenger/ui'; } from '@ucap-webmessenger/ui';
import { import {
@ -367,11 +370,21 @@ export class Effects {
() => { () => {
return this.actions$.pipe( return this.actions$.pipe(
ofType(userPasswordSetSuccess), ofType(userPasswordSetSuccess),
tap(action => { tap(async action => {
this.snackBarService.open(`비밀번호 변경이 완료 되었습니다`, '', { await this.dialogService.open<
duration: 3000, AlertDialogComponent,
verticalPosition: 'bottom' AlertDialogData,
AlertDialogResult
>(AlertDialogComponent, {
width: '360px',
disableClose: true,
data: {
title: '비밀번호 변경',
message: '비밀번호가 변경되었습니다. 다시 로그인하여 주십시오'
}
}); });
this.store.dispatch(logout());
}) })
); );
}, },

View File

@ -10,16 +10,17 @@ import { NGXLogger } from 'ngx-logger';
import { import {
makeWebSocketObservable, makeWebSocketObservable,
GetWebSocketResponses, GetWebSocketResponses,
NormalClosureMessage, NormalClosureMessage
} from '@ucap-webmessenger/web-socket'; } from '@ucap-webmessenger/web-socket';
import { PacketBody } from '../protocols/packet'; import { PacketBody } from '../protocols/packet';
import { import {
PacketBodyValueDivider, PacketBodyValueDivider,
PacketBodyDivider, PacketBodyDivider
} from '../types/packet-body-divider'; } from '../types/packet-body-divider';
import { PacketBodyValue } from '../types/packet-body-value.type'; import { PacketBodyValue } from '../types/packet-body-value.type';
import { SSVC_TYPE_ERROR_RES, ServerErrorCode } from '../types/service'; import { SSVC_TYPE_ERROR_RES } from '../types/service';
import { ServerErrorCode } from '../types/error-code';
import { ProtocolMessage } from '../protocols/protocol'; import { ProtocolMessage } from '../protocols/protocol';
import { _MODULE_CONFIG } from '../config/token'; import { _MODULE_CONFIG } from '../config/token';
@ -37,7 +38,7 @@ interface RequestState {
} }
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root'
}) })
export class ProtocolService { export class ProtocolService {
readonly urls: Urls; readonly urls: Urls;
@ -186,7 +187,7 @@ export class ProtocolService {
packet = this.encodePacket(serviceType, subServiceType, [ packet = this.encodePacket(serviceType, subServiceType, [
...bodyList, ...bodyList,
{ type: PacketBodyValue.RequestId, value: requestId }, { type: PacketBodyValue.RequestId, value: requestId }
]); ]);
responseSubject = new Subject<ProtocolMessage>().pipe( responseSubject = new Subject<ProtocolMessage>().pipe(
@ -209,7 +210,7 @@ export class ProtocolService {
this.pendingRequests.set(requestId, { this.pendingRequests.set(requestId, {
subject: responseSubject, subject: responseSubject,
request: { serviceType, subServiceType, bodyList }, request: { serviceType, subServiceType, bodyList }
}); });
} else { } else {
packet = this.encodePacket(serviceType, subServiceType, bodyList); packet = this.encodePacket(serviceType, subServiceType, bodyList);
@ -302,8 +303,8 @@ export class ProtocolService {
serviceType, serviceType,
subServiceType, subServiceType,
senderSeq, senderSeq,
bodyList, bodyList
}, }
}; };
} }

View File

@ -0,0 +1,48 @@
export enum ServerErrorCode {
/** 서버측에서 연결을 종료했습니다 */
ERRCD_FORCE_CLOSE = 10,
/** 통신 프로토콜이 일치하지않습니다 (최신 프로그램으로 업데이트 해주세요) */
ERRCD_PROTOCOL = 11,
/** 클라이언트 버전이 일치하지않습니다 (최신 프로그램으로 업데이트 해주세요) */
ERRCD_VERSION = 12,
/** 인증되지않은 기기입니다 */
ERRCD_DID = 13,
/** 로그인 아이디 또는 패스워드가 일치하지않습니다 */
ERRCD_IDPW = 14,
/** 다른 디바이스에서 로그인했습니다 */
ERRCD_DUPLICATE = 15,
/** 인증 토큰이 만료되었습니다 */
ERRCD_TOKEN = 16,
/** 프로그램을 재설치 바랍니다 */
ERRCD_SETUP_MAIN = 17,
/** 권한자/관리자에 의해 종료되었습니다 */
ERRCD_FORCE_INIT = 18,
/** 사용권한이 없습니다 */
ERRCD_NEED_AUTH_CLIENT = 19,
/** DEMO 서비스 기간이 종료되었습니다 */
ERRCD_SVC_EXPIRE = 99,
/** 요청 처리를 실패했습니다 */
ERRCD_FAILED = 100,
/** 데이터 처리를 실패했습니다 */
ERRCD_DATABASE = 101,
/** 최대치 넘음 */
ERRCD_EXCESS = 102,
/** 인증이 필요한 요청입니다 */
ERRCD_NEED_AUTH = 103,
/** */
ERRCD_USERINFO = 104,
/** 요청 처리를 실패했습니다(에러코드) */
ERRCD_INVALID_PARAM = 105,
/** 대화방에 함께 참여할 수 없는 사용자가 있습니다 */
ERRCD_INVALID_INVITE_USER = 106,
/** 상대방이 온라인 상태가 아닙니다 */
ERRCD_NOT_ONLINE = 200,
/** 패스워드 유효 기간이 만료 되었습니다 */
ERRCD_PW_EXPIRED = 300,
/** 요청을 처리할 권한이 없습니다 */
ERRCD_AUTH_DENY = 1000,
/** 암호화 처리 오류 */
ERRCD_ENCRYPT = 1001,
/** 다른 IP로 접속 요청 */
ERRCD_RECON = 1002
}

View File

@ -1,26 +1 @@
export const SSVC_TYPE_ERROR_RES = 1000; export const SSVC_TYPE_ERROR_RES = 1000;
export enum ServerErrorCode {
ERRCD_FORCE_CLOSE = 10,
ERRCD_PROTOCOL = 11,
ERRCD_VERSION = 12,
ERRCD_DID = 13,
ERRCD_IDPW = 14,
ERRCD_DUPLICATE = 15,
ERRCD_TOKEN = 16,
ERRCD_SETUP_MAIN = 17,
ERRCD_FORCE_INIT = 18,
ERRCD_SSO_AUTH = 19,
ERRCD_SSO_VALI = 20,
ERRCD_DEV_NOT_SUPPORTED = 21,
ERRCD_NO_MOBILE_PID = 22,
ERRCD_SVC_EXPIRE = 99,
ERRCD_FAILED = 100,
ERRCD_DATABASE = 101,
ERRCD_EXCESS = 102,
ERRCD_NEED_AUTH = 103,
ERRCD_USERINFO = 104, // ucap 은 없음.
ERRCD_AUTH_DENY = 1000,
ERRCD_ENCRYPT = 1001, // 패킷 암호화 오류
ERRCD_RECON = 1002 // 다른 IP로 접속 요청
}

View File

@ -10,6 +10,7 @@ export * from './lib/services/protocol.service';
export * from './lib/types/packet-body-divider'; export * from './lib/types/packet-body-divider';
export * from './lib/types/packet-body-value.type'; export * from './lib/types/packet-body-value.type';
export * from './lib/types/service'; export * from './lib/types/service';
export * from './lib/types/error-code';
export * from './lib/ucap-protocol.module'; export * from './lib/ucap-protocol.module';