bug fixed

This commit is contained in:
richard-loafle 2020-04-03 11:47:45 +09:00
parent 944b0dcaa3
commit c97ab001f6
12 changed files with 193 additions and 286 deletions

24
package-lock.json generated
View File

@ -1771,9 +1771,9 @@
"integrity": "sha512-RpCoRJWmHAFVZH809cYyNnHNwCZ3CuJA185d9kzAsIDUq6Y4FPAoGedUfUtZjwiMCfsP582f87sJzMUmVkn8IQ==" "integrity": "sha512-RpCoRJWmHAFVZH809cYyNnHNwCZ3CuJA185d9kzAsIDUq6Y4FPAoGedUfUtZjwiMCfsP582f87sJzMUmVkn8IQ=="
}, },
"@ucap/core": { "@ucap/core": {
"version": "0.0.5", "version": "0.0.6",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/core/-/core-0.0.5.tgz", "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/core/-/core-0.0.6.tgz",
"integrity": "sha512-Qg9Sgm1go7VCTtHCt8ihUeMxzZSIx2ZvhAE/XRKlHCOUm5hMUlIEvpp5gDPmlN+LBg+DtgZul7fi9G7iGiB7sA==" "integrity": "sha512-nLu1l7LzxgB/prkpxiWnF8yBpWRLZps8xRzRVpsC9bzxNsfoKC9ZYsUc48BYY0VlDNNb91oe8B+Dt4ec8q88fQ=="
}, },
"@ucap/logger": { "@ucap/logger": {
"version": "0.0.7", "version": "0.0.7",
@ -1926,19 +1926,19 @@
"integrity": "sha512-pHYNk/HVmE9C0GU/9nfkJZM0t0gV6c4FiWkDcDXUL8ZxYldqm2+aBLOofd0qLsHZUjq4qPRprecWQB+ACzOJxg==" "integrity": "sha512-pHYNk/HVmE9C0GU/9nfkJZM0t0gV6c4FiWkDcDXUL8ZxYldqm2+aBLOofd0qLsHZUjq4qPRprecWQB+ACzOJxg=="
}, },
"@ucap/ng-store-authentication": { "@ucap/ng-store-authentication": {
"version": "0.0.2", "version": "0.0.6",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-authentication/-/ng-store-authentication-0.0.2.tgz", "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-authentication/-/ng-store-authentication-0.0.6.tgz",
"integrity": "sha512-ohUQItPCnNKZrnBoH0lFNFSAHtZkRAfGnLTBXBa4+xapSKGO6h2XaWaszql+ava/q7nelFkNFmYHej0wVLWmdw==" "integrity": "sha512-qP3+rsni/z/JOTR/VPjH+09buvHphJc4IHMSS+HlAFvJPeLcWXWChANzpUG3tWNxEbrh8GhaOlzYkGyqBJTVLA=="
}, },
"@ucap/ng-store-chat": { "@ucap/ng-store-chat": {
"version": "0.0.3", "version": "0.0.4",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-chat/-/ng-store-chat-0.0.3.tgz", "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-chat/-/ng-store-chat-0.0.4.tgz",
"integrity": "sha512-T2MfjHqvP4J1fHJHVE3Mq/CYUnXZh+Uge8hUqDlX5V+KoaH5LUxz56/jX4OCpbwis1Uez+LxeG15IwuYMKZdvg==" "integrity": "sha512-rSZirwFUMv9zXllqBWpdSUbUuRz9j1O8BVIfselp9sZHdKl7Xcx9irqNnHHkF2bJpxeWzugGrgG02tdt/xrIuQ=="
}, },
"@ucap/ng-store-group": { "@ucap/ng-store-group": {
"version": "0.0.3", "version": "0.0.5",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-group/-/ng-store-group-0.0.3.tgz", "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-group/-/ng-store-group-0.0.5.tgz",
"integrity": "sha512-S/uognL5t0N5yQSoLOKHnvE01158wmP10p70Swfues9o88Ct55ABFOggDFdNcrHd9K7ei6S+objl3hIq/kg42w==" "integrity": "sha512-NNqnSiyQWbBIWLjXsBBxkdCHlRkMPRF8+IXq7scUgG7aNlUA0SGuntUbghRPxAJLQNuMe/csQziOlqHn98sJfw=="
}, },
"@ucap/ng-store-organization": { "@ucap/ng-store-organization": {
"version": "0.0.3", "version": "0.0.3",

View File

@ -37,7 +37,7 @@
"@ucap/api-message": "~0.0.3", "@ucap/api-message": "~0.0.3",
"@ucap/api-prompt": "~0.0.3", "@ucap/api-prompt": "~0.0.3",
"@ucap/api-public": "~0.0.4", "@ucap/api-public": "~0.0.4",
"@ucap/core": "~0.0.5", "@ucap/core": "~0.0.6",
"@ucap/logger": "~0.0.7", "@ucap/logger": "~0.0.7",
"@ucap/native": "~0.0.6", "@ucap/native": "~0.0.6",
"@ucap/native-browser": "~0.0.5", "@ucap/native-browser": "~0.0.5",
@ -68,9 +68,9 @@
"@ucap/ng-protocol-status": "~0.0.1", "@ucap/ng-protocol-status": "~0.0.1",
"@ucap/ng-protocol-sync": "~0.0.1", "@ucap/ng-protocol-sync": "~0.0.1",
"@ucap/ng-protocol-umg": "~0.0.1", "@ucap/ng-protocol-umg": "~0.0.1",
"@ucap/ng-store-authentication": "~0.0.2", "@ucap/ng-store-authentication": "~0.0.6",
"@ucap/ng-store-chat": "~0.0.3", "@ucap/ng-store-chat": "~0.0.4",
"@ucap/ng-store-group": "~0.0.3", "@ucap/ng-store-group": "~0.0.5",
"@ucap/ng-store-organization": "~0.0.3", "@ucap/ng-store-organization": "~0.0.3",
"@ucap/ng-web-storage": "~0.0.1", "@ucap/ng-web-storage": "~0.0.1",
"@ucap/ng-ui": "~0.0.3", "@ucap/ng-ui": "~0.0.3",

View File

@ -1,14 +1,7 @@
import { LocaleCode, DesktopType, DeviceType } from '@ucap/core'; import { LoginSession as UCAPLoginSession } from '@ucap/core';
export interface LoginSession { export interface LoginSession extends UCAPLoginSession {
loginId?: string;
loginPw?: string; loginPw?: string;
initPw?: boolean; initPw?: boolean;
companyCode?: string;
companyGroupType?: string;
companyGroupCode?: string;
localeCode?: LocaleCode;
encData?: string; encData?: string;
deviceType?: DeviceType;
desktopType?: DesktopType;
} }

View File

@ -1,5 +1,5 @@
import { Observable, forkJoin } from 'rxjs'; import { Observable, forkJoin } from 'rxjs';
import { take } from 'rxjs/operators'; import { take, concatMap } from 'rxjs/operators';
import { Injectable, Inject } from '@angular/core'; import { Injectable, Inject } from '@angular/core';
import { import {
@ -8,7 +8,7 @@ import {
RouterStateSnapshot RouterStateSnapshot
} from '@angular/router'; } from '@angular/router';
import { Store, select } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { StatusCode } from '@ucap/api'; import { StatusCode } from '@ucap/api';
import { NativeService } from '@ucap/native'; import { NativeService } from '@ucap/native';
@ -26,18 +26,12 @@ import { OptionProtocolService } from '@ucap/ng-protocol-option';
import { CompanyActions } from '@ucap/ng-store-organization'; import { CompanyActions } from '@ucap/ng-store-organization';
import { LoginActions } from '@ucap/ng-store-authentication'; import { LoginActions } from '@ucap/ng-store-authentication';
import {
BuddyActions,
BuddySelector,
GroupActions,
GroupSelector
} from '@ucap/ng-store-group';
import { RoomActions, RoomSelector } from '@ucap/ng-store-chat';
import { LoginSession } from '@app/models/login-session'; import { LoginSession } from '@app/models/login-session';
import { AppKey } from '@app/types/app-key.type'; import { AppKey } from '@app/types/app-key.type';
import { AppAuthenticationActions } from '@app/store/actions'; import { AppActions } from '@app/store/actions';
import { LogService } from '@ucap/ng-logger';
@Injectable() @Injectable()
export class AppAuthenticationResolver implements Resolve<void> { export class AppAuthenticationResolver implements Resolve<void> {
@ -51,6 +45,7 @@ export class AppAuthenticationResolver implements Resolve<void> {
private optionProtocolService: OptionProtocolService, private optionProtocolService: OptionProtocolService,
private store: Store<any>, private store: Store<any>,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private logService: LogService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {} ) {}
@ -79,6 +74,7 @@ export class AppAuthenticationResolver implements Resolve<void> {
}) })
); );
forkJoin([
this.publicApiService this.publicApiService
.versionInfo2({ .versionInfo2({
deviceType: loginSession.deviceType, deviceType: loginSession.deviceType,
@ -87,62 +83,65 @@ export class AppAuthenticationResolver implements Resolve<void> {
companyCode: loginSession.companyCode, companyCode: loginSession.companyCode,
loginId: loginSession.loginId loginId: loginSession.loginId
}) })
.pipe(take(1)) .pipe(take(1)),
.subscribe(
versionInfo2Res => {
if (StatusCode.Fail === versionInfo2Res.statusCode) {
this.store.dispatch(
AppAuthenticationActions.versionInfo2Failure({
error: versionInfo2Res.errorMessage
})
);
reject(versionInfo2Res.errorMessage);
return;
}
this.store.dispatch(
AppAuthenticationActions.versionInfo2Success({
res: versionInfo2Res
})
);
this.protocolService
.connect(versionInfo2Res.serverIp)
.pipe(take(1))
.subscribe(
() => {
this.externalApiService this.externalApiService
.urlInfo({ .urlInfo({
deviceType: loginSession.deviceType, deviceType: loginSession.deviceType,
loginId: loginSession.loginId loginId: loginSession.loginId
}) })
.pipe(take(1)) .pipe(take(1))
])
.pipe(take(1))
.subscribe( .subscribe(
urlInfoRes => { ([versionInfo2Res, urlInfoRes]) => {
if (StatusCode.Fail === urlInfoRes.statusCode) { if (
StatusCode.Fail === versionInfo2Res.statusCode ||
StatusCode.Fail === urlInfoRes.statusCode
) {
if (StatusCode.Fail === versionInfo2Res.statusCode) {
this.store.dispatch( this.store.dispatch(
AppAuthenticationActions.urlInfoFailure({ AppActions.versionInfo2Failure({
error: versionInfo2Res.errorMessage error: versionInfo2Res.errorMessage
}) })
); );
reject(versionInfo2Res.errorMessage);
}
if (StatusCode.Fail === urlInfoRes.statusCode) {
this.store.dispatch(
AppActions.urlInfoFailure({
error: urlInfoRes.errorMessage
})
);
reject(urlInfoRes.errorMessage); reject(urlInfoRes.errorMessage);
}
return; return;
} }
this.store.dispatch( this.store.dispatch(
AppAuthenticationActions.urlInfoSuccess({ AppActions.versionInfo2Success({
res: versionInfo2Res res: versionInfo2Res
}) })
); );
this.innerProtocolService this.store.dispatch(
.conn({}) AppActions.urlInfoSuccess({
.pipe(take(1)) res: urlInfoRes
.subscribe( })
connRes => { );
this.authenticationProtocolService
this.protocolService
.connect(versionInfo2Res.serverIp)
.pipe(
take(1),
concatMap(() => {
return this.innerProtocolService.conn({}).pipe(
take(1),
concatMap(connRes => {
return this.authenticationProtocolService
.login({ .login({
loginId: loginSession.loginId, loginId: loginSession.loginId,
loginPw: loginSession.loginPw, loginPw: loginSession.loginPw,
@ -162,79 +161,19 @@ export class AppAuthenticationResolver implements Resolve<void> {
andId: '', andId: '',
andPushRefreshYn: '' andPushRefreshYn: ''
}) })
.pipe(take(1)) .pipe(take(1));
})
);
})
)
.subscribe( .subscribe(
loginRes => { loginRes => {
this.store.dispatch( this.store.dispatch(
LoginActions.loginSuccess({ loginRes }) LoginActions.loginSuccess({
); res: loginRes,
loginSession
forkJoin([
this.queryProtocolService
.auth({
deviceType: loginSession.deviceType
})
.pipe(take(1)),
this.optionProtocolService
.regView({})
.pipe(take(1))
])
.pipe(take(1))
.subscribe(
([authRes, regViewRes]) => {
forkJoin([
this.store.pipe(
take(1),
select(
BuddySelector.buddySyncDate
)
),
this.store.pipe(
take(1),
select(
GroupSelector.groupSyncDate
)
),
this.store.pipe(
take(1),
select(
RoomSelector.roomsSyncDate
)
)
])
.pipe(take(1))
.subscribe(
([
buddySyncDate,
groupSyncDate,
roomsSyncDate
]) => {
this.store.dispatch(
BuddyActions.buddy2({
req: {
syncDate: buddySyncDate
}
}) })
); );
this.store.dispatch(
GroupActions.groups({
req: {
syncDate: groupSyncDate
}
})
);
this.store.dispatch(
RoomActions.rooms({
req: {
localeCode:
loginSession.localeCode,
syncDate: roomsSyncDate
}
})
);
}
);
resolve(); resolve();
}, },
error => { error => {
@ -243,39 +182,6 @@ export class AppAuthenticationResolver implements Resolve<void> {
); );
}, },
error => { error => {
this.store.dispatch(
LoginActions.loginFailure({ error })
);
reject(error);
}
);
},
error => {
reject(error);
}
);
},
error => {
this.store.dispatch(
AppAuthenticationActions.urlInfoFailure({
error
})
);
reject(error);
}
);
},
error => {
reject(error);
}
);
},
error => {
this.store.dispatch(
AppAuthenticationActions.versionInfo2Failure({
error
})
);
reject(error); reject(error);
} }
); );

View File

@ -1,6 +1,34 @@
import { createAction, props } from '@ngrx/store'; import { createAction, props } from '@ngrx/store';
/** import { VersionInfo2Response, VersionInfo2Request } from '@ucap/api-public';
* APP_INITIALIZER import { UrlInfoRequest, UrlInfoResponse } from '@ucap/api-external';
*/
export const initializer = createAction('[ucap::app::app] initializer'); export const versionInfo2 = createAction(
'[ucap::app::app] versionInfo2',
props<{ req: VersionInfo2Request }>()
);
export const versionInfo2Success = createAction(
'[ucap::app::app] versionInfo2 Success',
props<{ res: VersionInfo2Response }>()
);
export const versionInfo2Failure = createAction(
'[ucap::app::app] versionInfo2 Failure',
props<{ error: any }>()
);
export const urlInfo = createAction(
'[ucap::app::app] urlInfo',
props<{ req: UrlInfoRequest }>()
);
export const urlInfoSuccess = createAction(
'[ucap::app::app] urlInfo Success',
props<{ res: UrlInfoResponse }>()
);
export const urlInfoFailure = createAction(
'[ucap::app::app] urlInfo Failure',
props<{ error: any }>()
);

View File

@ -1,4 +1,25 @@
import { createReducer, on } from '@ngrx/store'; import { createReducer, on } from '@ngrx/store';
import { initialState } from './state'; import { initialState } from './state';
import { versionInfo2Success, urlInfoSuccess } from './actions';
export const reducer = createReducer(initialState); export const reducer = createReducer(
initialState,
on(versionInfo2Success, (state, action) => {
return {
...state,
versionInfo2Response: {
...state.versionInfo2Response,
...action.res
}
};
}),
on(urlInfoSuccess, (state, action) => {
return {
...state,
urlInfoResponse: {
...state.urlInfoResponse,
...action.res
}
};
})
);

View File

@ -1,9 +1,27 @@
import { Selector, createSelector } from '@ngrx/store'; import { Selector, createSelector } from '@ngrx/store';
export interface State {} import { VersionInfo2Response } from '@ucap/api-public';
import { UrlInfoResponse } from '@ucap/api-external';
export const initialState: State = {}; export interface State {
versionInfo2Response: VersionInfo2Response | null;
urlInfoResponse: UrlInfoResponse | null;
}
export const initialState: State = {
versionInfo2Response: null,
urlInfoResponse: null
};
export function selectors<S>(selector: Selector<any, State>) { export function selectors<S>(selector: Selector<any, State>) {
return {}; return {
versionInfo2Response: createSelector(
selector,
(state: State) => state.versionInfo2Response
),
urlInfoResponse: createSelector(
selector,
(state: State) => state.urlInfoResponse
)
};
} }

View File

@ -1,34 +1,5 @@
import { createAction, props } from '@ngrx/store'; import { createAction, props } from '@ngrx/store';
import { VersionInfo2Response, VersionInfo2Request } from '@ucap/api-public'; export const initializer = createAction(
import { UrlInfoRequest, UrlInfoResponse } from '@ucap/api-external'; '[ucap::app::authentication] initializer'
export const versionInfo2 = createAction(
'[ucap::app::authentication] versionInfo2',
props<{ req: VersionInfo2Request }>()
);
export const versionInfo2Success = createAction(
'[ucap::app::authentication] versionInfo2 Success',
props<{ res: VersionInfo2Response }>()
);
export const versionInfo2Failure = createAction(
'[ucap::app::authentication] versionInfo2 Failure',
props<{ error: any }>()
);
export const urlInfo = createAction(
'[ucap::app::authentication] urlInfo',
props<{ req: UrlInfoRequest }>()
);
export const urlInfoSuccess = createAction(
'[ucap::app::authentication] urlInfo Success',
props<{ res: UrlInfoResponse }>()
);
export const urlInfoFailure = createAction(
'[ucap::app::authentication] urlInfo Failure',
props<{ error: any }>()
); );

View File

@ -1,17 +1,5 @@
import { createReducer, on } from '@ngrx/store'; import { createReducer, on } from '@ngrx/store';
import { initialState } from './state'; import { initialState } from './state';
import { versionInfo2Success } from './actions';
export const reducer = createReducer( export const reducer = createReducer(initialState);
initialState,
on(versionInfo2Success, (state, action) => {
return {
...state,
versionInfo2Response: {
...state.versionInfo2Response,
...action.res
}
};
})
);

View File

@ -1,27 +1,9 @@
import { Selector, createSelector } from '@ngrx/store'; import { Selector, createSelector } from '@ngrx/store';
import { VersionInfo2Response } from '@ucap/api-public'; export interface State {}
import { UrlInfoResponse } from '@ucap/api-external';
export interface State { export const initialState: State = {};
versionInfo2Response: VersionInfo2Response | null;
urlInfoResponse: UrlInfoResponse | null;
}
export const initialState: State = {
versionInfo2Response: null,
urlInfoResponse: null
};
export function selectors<S>(selector: Selector<any, State>) { export function selectors<S>(selector: Selector<any, State>) {
return { return {};
versionInfo2Response: createSelector(
selector,
(state: State) => state.versionInfo2Response
),
urlInfoResponse: createSelector(
selector,
(state: State) => state.urlInfoResponse
)
};
} }

View File

@ -113,7 +113,7 @@ export const environment: Environment = {
hostConfig: { hostConfig: {
protocol: 'http', protocol: 'http',
domain: '13.124.88.127', domain: '13.124.88.127',
port: 8033 port: 8011
}, },
urls: publicApiUrls urls: publicApiUrls
}, },

View File

@ -116,7 +116,7 @@ export const environment: Environment = {
hostConfig: { hostConfig: {
protocol: 'http', protocol: 'http',
domain: '13.124.88.127', domain: '13.124.88.127',
port: 8033 port: 8011
}, },
urls: publicApiUrls urls: publicApiUrls
}, },