diff --git a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts index 7af2e8b7..5cd7b167 100644 --- a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts +++ b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts @@ -17,6 +17,11 @@ import * as AppStore from '../store'; import * as VersionInfoStore from '../store/setting/version-info'; import { LoginInfo, KEY_LOGIN_INFO } from '../types'; import { InnerProtocolService } from '@ucap-webmessenger/protocol-inner'; +import { + AuthenticationProtocolService, + SSOMode +} from '@ucap-webmessenger/protocol-authentication'; +import { LocaleCode } from '@ucap-webmessenger/core'; @Injectable() export class MessengerResolver implements Resolve { @@ -25,6 +30,7 @@ export class MessengerResolver implements Resolve { private sessionStorageService: SessionStorageService, private publicApiService: PublicApiService, private protocolService: ProtocolService, + private authenticationProtocolService: AuthenticationProtocolService, private innerProtocolService: InnerProtocolService ) {} @@ -51,9 +57,33 @@ export class MessengerResolver implements Resolve { this.innerProtocolService .conn({}) .pipe( - take(1), - map(() => { - console.log('innerProtocolService.conn'); + map(connRes => { + this.authenticationProtocolService + .login({ + loginId: loginInfo.loginId, + loginPw: loginInfo.loginPw, + deviceType: loginInfo.deviceType, + deviceId: ' ', + token: '', + localeCode: LocaleCode.Korean, + pushId: ' ', + companyCode: loginInfo.companyCode, + passwordEncodingType: 1, + clientVersion: '', + reconnect: false, + ip: 'localhost', + hostName: '', + ssoMode: SSOMode.AUTH, + userSpecificInformation: 'PRO_000482', + productId: 'PRO_000482', + productName: 'EZMessenger' + }) + .pipe( + map(loginRes => { + console.log('loginRes', loginRes); + }) + ) + .subscribe(); }) ) .subscribe(); diff --git a/projects/ucap-webmessenger-protocol-authentication/src/lib/models/login.ts b/projects/ucap-webmessenger-protocol-authentication/src/lib/models/login.ts index 1f203599..6a98dc5e 100644 --- a/projects/ucap-webmessenger-protocol-authentication/src/lib/models/login.ts +++ b/projects/ucap-webmessenger-protocol-authentication/src/lib/models/login.ts @@ -13,7 +13,7 @@ export interface LoginRequest extends ProtocolRequest { // 3. 디바이스ID(s) (for mobile) deviceId: string; // 4. Token(n) - token: number; + token: string; // 5. 언어코드(s) localeCode: LocaleCode; // 6. Push ID (for mobile) diff --git a/projects/ucap-webmessenger-protocol-authentication/src/lib/services/authentication-protocol.service.ts b/projects/ucap-webmessenger-protocol-authentication/src/lib/services/authentication-protocol.service.ts index 873fbc3d..bcf5a237 100644 --- a/projects/ucap-webmessenger-protocol-authentication/src/lib/services/authentication-protocol.service.ts +++ b/projects/ucap-webmessenger-protocol-authentication/src/lib/services/authentication-protocol.service.ts @@ -30,11 +30,11 @@ export class AuthenticationProtocolService { { type: PacketBodyValue.String, value: req.loginPw }, { type: PacketBodyValue.String, value: req.deviceType }, { type: PacketBodyValue.String, value: req.deviceId }, - { type: PacketBodyValue.Integer, value: req.token }, + { type: PacketBodyValue.String, value: req.token }, { type: PacketBodyValue.String, value: req.localeCode }, { type: PacketBodyValue.String, value: req.pushId }, { type: PacketBodyValue.String, value: req.companyCode }, - { type: PacketBodyValue.String, value: req.passwordEncodingType }, + { type: PacketBodyValue.Integer, value: req.passwordEncodingType }, { type: PacketBodyValue.String, value: req.clientVersion }, { type: PacketBodyValue.String, value: req.reconnect ? 'Y' : 'N' }, { type: PacketBodyValue.String, value: req.ip }, diff --git a/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts b/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts index 1c29b42c..8662dd13 100644 --- a/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts +++ b/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts @@ -72,8 +72,6 @@ export class ProtocolService { this.messagesSubscription = this.messages$.subscribe( (message: string) => { - console.log(`message`, message); - const arg = message.split(PacketBodyDivider); if (2 > arg.length) { // OnError(3); @@ -212,7 +210,7 @@ export class ProtocolService { } const valueType: PacketBodyValue = bodyArg[0] as PacketBodyValue; - const value = bodyArg[0]; + const value = bodyArg[1]; switch (valueType) { case PacketBodyValue.None: @@ -275,13 +273,13 @@ export class ProtocolService { switch (body.type) { case PacketBodyValue.None: - packet.push(body.value.toString()); + packet.push(body.value); break; case PacketBodyValue.Binary: - packet.push(body.value.toString()); + packet.push(body.value); break; case PacketBodyValue.Integer: - packet.push(body.value.toString()); + packet.push(String(body.value)); break; case PacketBodyValue.String: packet.push(body.value); @@ -299,7 +297,7 @@ export class ProtocolService { packet.push(body.value); break; case PacketBodyValue.RequestId: - packet.push(body.value.toString()); + packet.push(String(body.value)); break; default: break;