bug of login protocol is fixed
This commit is contained in:
parent
834c25762c
commit
977a6bcdc0
|
@ -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<void> {
|
||||
|
@ -25,6 +30,7 @@ export class MessengerResolver implements Resolve<void> {
|
|||
private sessionStorageService: SessionStorageService,
|
||||
private publicApiService: PublicApiService,
|
||||
private protocolService: ProtocolService,
|
||||
private authenticationProtocolService: AuthenticationProtocolService,
|
||||
private innerProtocolService: InnerProtocolService
|
||||
) {}
|
||||
|
||||
|
@ -51,9 +57,33 @@ export class MessengerResolver implements Resolve<void> {
|
|||
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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user