bug fixed
This commit is contained in:
parent
40f2587b3a
commit
2435cd88c8
53
package-lock.json
generated
53
package-lock.json
generated
|
@ -1846,9 +1846,9 @@
|
||||||
"integrity": "sha512-bMHXrXFI2+cKjEwUs7GMSZwM2OZoA/PSavlzAx5NhzvN1Cg7Mz4mspjky++/7eRnYeqRUm7UmdOKAhdRdHprPQ=="
|
"integrity": "sha512-bMHXrXFI2+cKjEwUs7GMSZwM2OZoA/PSavlzAx5NhzvN1Cg7Mz4mspjky++/7eRnYeqRUm7UmdOKAhdRdHprPQ=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-protocol": {
|
"@ucap/ng-protocol": {
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-protocol/-/ng-protocol-0.0.2.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-protocol/-/ng-protocol-0.0.3.tgz",
|
||||||
"integrity": "sha512-fNbmiIrXECeKowvjGflx2lOcOCykH42QKSZzciOeoSxHF8HiFT8ORN5BlR6GOknUCXvGwVPDccNwUs0t1QCnjg=="
|
"integrity": "sha512-9aGv4bDKfOjDXWD56THW/KPDdAp2ytaWZSFnbw3PMy8bKiyfRQH/UXrj9c9jrf2aNhnSVvYjh1ol4oXNL8EYMg=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-protocol-authentication": {
|
"@ucap/ng-protocol-authentication": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
|
@ -1926,24 +1926,24 @@
|
||||||
"integrity": "sha512-cMfKYv56L7KQ8D9LRxFeE/fY2bl6Vw1WwH8FQKjI6ntD+pr7LgVQZzMMDjN0xfMW0rCS+MhmTU+WAcHgkLlqRA=="
|
"integrity": "sha512-cMfKYv56L7KQ8D9LRxFeE/fY2bl6Vw1WwH8FQKjI6ntD+pr7LgVQZzMMDjN0xfMW0rCS+MhmTU+WAcHgkLlqRA=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-store-authentication": {
|
"@ucap/ng-store-authentication": {
|
||||||
"version": "0.0.7",
|
"version": "0.0.10",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-authentication/-/ng-store-authentication-0.0.7.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-authentication/-/ng-store-authentication-0.0.10.tgz",
|
||||||
"integrity": "sha512-6IxxjFYpmN3xC2zIix9BfXbHHKpZeeS09SlT7RujMGt58CPyLnWkCFa/a4NILYQpUaXwQn+CmB1o8nhaZvwMNw=="
|
"integrity": "sha512-eGdxf9VXmwLlhwpMndnAQUaKV/JaMmtxebSN+kiez8czQiqVKFXSjdVyA92/3AscMf5GvdwKMMh553IT7EhpqA=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-store-chat": {
|
"@ucap/ng-store-chat": {
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-chat/-/ng-store-chat-0.0.4.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-chat/-/ng-store-chat-0.0.5.tgz",
|
||||||
"integrity": "sha512-rSZirwFUMv9zXllqBWpdSUbUuRz9j1O8BVIfselp9sZHdKl7Xcx9irqNnHHkF2bJpxeWzugGrgG02tdt/xrIuQ=="
|
"integrity": "sha512-FlvWI52w58jq/ZO8b8sk/MonY+TYKiEYlkyIfZWfFYOxlnKG0MkbpL0R+tiOFO9GLbBGEsXrzYtaDazrLk55ZQ=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-store-group": {
|
"@ucap/ng-store-group": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-group/-/ng-store-group-0.0.5.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-group/-/ng-store-group-0.0.6.tgz",
|
||||||
"integrity": "sha512-NNqnSiyQWbBIWLjXsBBxkdCHlRkMPRF8+IXq7scUgG7aNlUA0SGuntUbghRPxAJLQNuMe/csQziOlqHn98sJfw=="
|
"integrity": "sha512-WShenZp/RP+cgiswvM12HPWOeSFuhNYkCUY6fxEAg58unxUZhBskVhefSq+OgD3dX/OaAPo2eQkwvXVANnyiZw=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-store-organization": {
|
"@ucap/ng-store-organization": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-organization/-/ng-store-organization-0.0.3.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-organization/-/ng-store-organization-0.0.4.tgz",
|
||||||
"integrity": "sha512-qakDmEzWloikSk/Sczs2i/dL54ZAIEqkjx2x4jcn0dMKkCF2KseCphNXTfaLpAcMuGVR5ZAy2bQjy90NbbHeOg=="
|
"integrity": "sha512-gVGOTfGmp58U0nHEn0UkjMc9AWQEmopNXDbyIrltMwR5XCKweC9AWXAiQzDxCb3sN07cSozEseFBJzJ7XO+dwg=="
|
||||||
},
|
},
|
||||||
"@ucap/ng-ui": {
|
"@ucap/ng-ui": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
|
@ -1965,6 +1965,11 @@
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-ui-skin-default/-/ng-ui-skin-default-0.0.1.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-ui-skin-default/-/ng-ui-skin-default-0.0.1.tgz",
|
||||||
"integrity": "sha512-vtgJBOsJj/S2GjP02PpBz9ebGikNtzdsC7JQc5HKkCZRC6JKkzZmWzcaFGlLPsh9dcWEeZuNhwnAZfmPXgz6Aw=="
|
"integrity": "sha512-vtgJBOsJj/S2GjP02PpBz9ebGikNtzdsC7JQc5HKkCZRC6JKkzZmWzcaFGlLPsh9dcWEeZuNhwnAZfmPXgz6Aw=="
|
||||||
},
|
},
|
||||||
|
"@ucap/ng-web-socket": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-web-socket/-/ng-web-socket-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-hMn8niCiRfR3ZUzE0oqspJGlGl0DKvLizkVMphF+JenqwARQcBYR+G7e+4HPEGyRbu0LtimkhMfExzJFTHky3A=="
|
||||||
|
},
|
||||||
"@ucap/ng-web-storage": {
|
"@ucap/ng-web-storage": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-web-storage/-/ng-web-storage-0.0.3.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-web-storage/-/ng-web-storage-0.0.3.tgz",
|
||||||
|
@ -1976,9 +1981,9 @@
|
||||||
"integrity": "sha512-nWev387pHxeBHtOu0EvRTVQ0/JeJL44Ew0PzQaiqHsC5mghkJ6ok7z22nk9nmuZ7lONxGJmW7CHT8X8lyviZJg=="
|
"integrity": "sha512-nWev387pHxeBHtOu0EvRTVQ0/JeJL44Ew0PzQaiqHsC5mghkJ6ok7z22nk9nmuZ7lONxGJmW7CHT8X8lyviZJg=="
|
||||||
},
|
},
|
||||||
"@ucap/protocol": {
|
"@ucap/protocol": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.11",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/protocol/-/protocol-0.0.8.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/protocol/-/protocol-0.0.11.tgz",
|
||||||
"integrity": "sha512-cLFryVjd3VLAEJScJiZ2Dm+Uuo5uqX0BHE9ZIdu99BSoDMyODOuBxPFBXAWaxiqX0H5jJHAU3m6leGVv1P2alg=="
|
"integrity": "sha512-nmwejglPVtC7elUn8x05ENFyqFz0z2pFibpblqAUW3m8HQHBSIKLqfctVsHzk5iP9/JyCDCTDuJ2DjMhMVJB8g=="
|
||||||
},
|
},
|
||||||
"@ucap/protocol-authentication": {
|
"@ucap/protocol-authentication": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
|
@ -2026,9 +2031,9 @@
|
||||||
"integrity": "sha512-w6jLCCVew66WrDbN/SkC3ND1Rj7u22wkbDCQxuW87hJt/PdfGPu4fnep6OL8GCo4CtLCgUEt7iOWNAxMv8ipUg=="
|
"integrity": "sha512-w6jLCCVew66WrDbN/SkC3ND1Rj7u22wkbDCQxuW87hJt/PdfGPu4fnep6OL8GCo4CtLCgUEt7iOWNAxMv8ipUg=="
|
||||||
},
|
},
|
||||||
"@ucap/protocol-query": {
|
"@ucap/protocol-query": {
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/protocol-query/-/protocol-query-0.0.4.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/protocol-query/-/protocol-query-0.0.5.tgz",
|
||||||
"integrity": "sha512-cRMZgrOfKFPJKz+bPTxYOAhTQfgYvAjGvAXgcK8FzQ51R3jwmVTXsHi8FBBfqOeI2bDw1/KkPBfhChHRF2h+kg=="
|
"integrity": "sha512-z8NGdXxw1C3FplynHbglO3Vk9vEIimu9pYWxXNtT9pEErcei4fyosV9DO+7UMPmBfXa47WlyKjLQlKQuPjcyMg=="
|
||||||
},
|
},
|
||||||
"@ucap/protocol-room": {
|
"@ucap/protocol-room": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
|
@ -2056,9 +2061,9 @@
|
||||||
"integrity": "sha512-PVrQJC5g+eywOPQ8BATnlr3UDLXW7HDZpNuBCablvtEcylIIIbP0czsZsEWGuLCJqSQ9pZy/sEQDbGiM7yTpmQ=="
|
"integrity": "sha512-PVrQJC5g+eywOPQ8BATnlr3UDLXW7HDZpNuBCablvtEcylIIIbP0czsZsEWGuLCJqSQ9pZy/sEQDbGiM7yTpmQ=="
|
||||||
},
|
},
|
||||||
"@ucap/web-socket": {
|
"@ucap/web-socket": {
|
||||||
"version": "0.0.2",
|
"version": "0.0.5",
|
||||||
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/web-socket/-/web-socket-0.0.2.tgz",
|
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/web-socket/-/web-socket-0.0.5.tgz",
|
||||||
"integrity": "sha512-hKAEsIzMhUuR8u26ENkuIAh4Xp8ltzBlZggxhqtLifP8KbgQdWD3w3+1M1697MPni8q42+Q/ZH/1IHLdi8KB7w=="
|
"integrity": "sha512-BsdH5llLxlFGPjER3rvSLaNKtdQyXhhVyAbPStYJPstBNfcyq0Al8/C97aXFWlpLrmvib+s3AT7o1OmPhv8ZWw=="
|
||||||
},
|
},
|
||||||
"@ucap/web-storage": {
|
"@ucap/web-storage": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
|
|
17
package.json
17
package.json
|
@ -52,7 +52,7 @@
|
||||||
"@ucap/ng-native": "~0.0.1",
|
"@ucap/ng-native": "~0.0.1",
|
||||||
"@ucap/ng-native-browser": "~0.0.1",
|
"@ucap/ng-native-browser": "~0.0.1",
|
||||||
"@ucap/ng-pi": "~0.0.1",
|
"@ucap/ng-pi": "~0.0.1",
|
||||||
"@ucap/ng-protocol": "~0.0.2",
|
"@ucap/ng-protocol": "~0.0.3",
|
||||||
"@ucap/ng-protocol-authentication": "~0.0.3",
|
"@ucap/ng-protocol-authentication": "~0.0.3",
|
||||||
"@ucap/ng-protocol-buddy": "~0.0.3",
|
"@ucap/ng-protocol-buddy": "~0.0.3",
|
||||||
"@ucap/ng-protocol-event": "~0.0.3",
|
"@ucap/ng-protocol-event": "~0.0.3",
|
||||||
|
@ -68,17 +68,18 @@
|
||||||
"@ucap/ng-protocol-status": "~0.0.3",
|
"@ucap/ng-protocol-status": "~0.0.3",
|
||||||
"@ucap/ng-protocol-sync": "~0.0.3",
|
"@ucap/ng-protocol-sync": "~0.0.3",
|
||||||
"@ucap/ng-protocol-umg": "~0.0.3",
|
"@ucap/ng-protocol-umg": "~0.0.3",
|
||||||
"@ucap/ng-store-authentication": "~0.0.7",
|
"@ucap/ng-store-authentication": "~0.0.10",
|
||||||
"@ucap/ng-store-chat": "~0.0.4",
|
"@ucap/ng-store-chat": "~0.0.5",
|
||||||
"@ucap/ng-store-group": "~0.0.5",
|
"@ucap/ng-store-group": "~0.0.6",
|
||||||
"@ucap/ng-store-organization": "~0.0.3",
|
"@ucap/ng-store-organization": "~0.0.4",
|
||||||
|
"@ucap/ng-web-socket": "~0.0.2",
|
||||||
"@ucap/ng-web-storage": "~0.0.3",
|
"@ucap/ng-web-storage": "~0.0.3",
|
||||||
"@ucap/ng-ui": "~0.0.3",
|
"@ucap/ng-ui": "~0.0.3",
|
||||||
"@ucap/ng-ui-organization": "~0.0.2",
|
"@ucap/ng-ui-organization": "~0.0.2",
|
||||||
"@ucap/ng-ui-authentication": "~0.0.15",
|
"@ucap/ng-ui-authentication": "~0.0.15",
|
||||||
"@ucap/ng-ui-skin-default": "~0.0.1",
|
"@ucap/ng-ui-skin-default": "~0.0.1",
|
||||||
"@ucap/pi": "~0.0.5",
|
"@ucap/pi": "~0.0.5",
|
||||||
"@ucap/protocol": "~0.0.8",
|
"@ucap/protocol": "~0.0.11",
|
||||||
"@ucap/protocol-authentication": "~0.0.5",
|
"@ucap/protocol-authentication": "~0.0.5",
|
||||||
"@ucap/protocol-buddy": "~0.0.5",
|
"@ucap/protocol-buddy": "~0.0.5",
|
||||||
"@ucap/protocol-event": "~0.0.5",
|
"@ucap/protocol-event": "~0.0.5",
|
||||||
|
@ -88,13 +89,13 @@
|
||||||
"@ucap/protocol-inner": "~0.0.4",
|
"@ucap/protocol-inner": "~0.0.4",
|
||||||
"@ucap/protocol-option": "~0.0.7",
|
"@ucap/protocol-option": "~0.0.7",
|
||||||
"@ucap/protocol-ping": "~0.0.4",
|
"@ucap/protocol-ping": "~0.0.4",
|
||||||
"@ucap/protocol-query": "~0.0.4",
|
"@ucap/protocol-query": "~0.0.5",
|
||||||
"@ucap/protocol-room": "~0.0.5",
|
"@ucap/protocol-room": "~0.0.5",
|
||||||
"@ucap/protocol-service": "~0.0.4",
|
"@ucap/protocol-service": "~0.0.4",
|
||||||
"@ucap/protocol-status": "~0.0.5",
|
"@ucap/protocol-status": "~0.0.5",
|
||||||
"@ucap/protocol-sync": "~0.0.4",
|
"@ucap/protocol-sync": "~0.0.4",
|
||||||
"@ucap/protocol-umg": "~0.0.5",
|
"@ucap/protocol-umg": "~0.0.5",
|
||||||
"@ucap/web-socket": "~0.0.2",
|
"@ucap/web-socket": "~0.0.5",
|
||||||
"@ucap/web-storage": "~0.0.5",
|
"@ucap/web-storage": "~0.0.5",
|
||||||
"autolinker": "^3.13.0",
|
"autolinker": "^3.13.0",
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
|
|
|
@ -9,14 +9,14 @@ import { environment } from '@environments';
|
||||||
|
|
||||||
import { AppAuthenticationGuard } from './guards/app-authentication.guard';
|
import { AppAuthenticationGuard } from './guards/app-authentication.guard';
|
||||||
|
|
||||||
import { AppAuthenticationResolver } from './resolvers/app-authentication.resolver';
|
import { AppSessionResolver } from './resolvers/app-session.resolver';
|
||||||
|
|
||||||
import { AppAuthenticationService } from './services/app-authentication.service';
|
import { AppAuthenticationService } from './services/app-authentication.service';
|
||||||
import { AppNativeService } from './services/app-native.service';
|
import { AppNativeService } from './services/app-native.service';
|
||||||
import { AppService } from './services/app.service';
|
import { AppService } from './services/app.service';
|
||||||
|
|
||||||
const GUARDS = [AppAuthenticationGuard];
|
const GUARDS = [AppAuthenticationGuard];
|
||||||
const RESOLVERS = [AppAuthenticationResolver];
|
const RESOLVERS = [AppSessionResolver];
|
||||||
const SERVICES = [AppService, AppAuthenticationService, AppNativeService];
|
const SERVICES = [AppService, AppAuthenticationService, AppNativeService];
|
||||||
|
|
||||||
const axiosFactory = () => {
|
const axiosFactory = () => {
|
||||||
|
|
|
@ -5,13 +5,13 @@ import { DefaultLayoutComponent } from '@app/layouts/components/default.layout.c
|
||||||
import { NoNaviLayoutComponent } from '@app/layouts/components/no-navi.layout.component';
|
import { NoNaviLayoutComponent } from '@app/layouts/components/no-navi.layout.component';
|
||||||
|
|
||||||
import { AppAuthenticationGuard } from '@app/guards/app-authentication.guard';
|
import { AppAuthenticationGuard } from '@app/guards/app-authentication.guard';
|
||||||
import { AppAuthenticationResolver } from './resolvers/app-authentication.resolver';
|
import { AppSessionResolver } from './resolvers/app-session.resolver';
|
||||||
|
|
||||||
export function appMatcher(url: UrlSegment[]) {
|
export function appMatcher(url: UrlSegment[]) {
|
||||||
if (1 === url.length) {
|
if (1 === url.length) {
|
||||||
if (
|
if (
|
||||||
['organization', 'group', 'chat', 'message'].some(
|
['organization', 'group', 'chat', 'message'].some((p) =>
|
||||||
(p) => p === url[0].path
|
url[0].path.startsWith(p)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return { consumed: url };
|
return { consumed: url };
|
||||||
|
@ -21,6 +21,7 @@ export function appMatcher(url: UrlSegment[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
|
{ path: '', redirectTo: '/organization', pathMatch: 'full' },
|
||||||
{
|
{
|
||||||
path: 'account',
|
path: 'account',
|
||||||
component: NoNaviLayoutComponent,
|
component: NoNaviLayoutComponent,
|
||||||
|
@ -42,7 +43,7 @@ const routes: Routes = [
|
||||||
component: DefaultLayoutComponent,
|
component: DefaultLayoutComponent,
|
||||||
canActivate: [AppAuthenticationGuard],
|
canActivate: [AppAuthenticationGuard],
|
||||||
resolve: {
|
resolve: {
|
||||||
authentication: AppAuthenticationResolver
|
session: AppSessionResolver
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -35,6 +35,7 @@ import { StatusProtocolModule } from '@ucap/ng-protocol-status';
|
||||||
import { SyncProtocolModule } from '@ucap/ng-protocol-sync';
|
import { SyncProtocolModule } from '@ucap/ng-protocol-sync';
|
||||||
import { UmgProtocolModule } from '@ucap/ng-protocol-umg';
|
import { UmgProtocolModule } from '@ucap/ng-protocol-umg';
|
||||||
|
|
||||||
|
import { WebSocketModule } from '@ucap/ng-web-socket';
|
||||||
import { WebStorageModule } from '@ucap/ng-web-storage';
|
import { WebStorageModule } from '@ucap/ng-web-storage';
|
||||||
|
|
||||||
import { I18nModule } from '@ucap/ng-i18n';
|
import { I18nModule } from '@ucap/ng-i18n';
|
||||||
|
@ -91,6 +92,7 @@ import { environment } from '@environments';
|
||||||
SyncProtocolModule.forRoot({}),
|
SyncProtocolModule.forRoot({}),
|
||||||
UmgProtocolModule.forRoot({}),
|
UmgProtocolModule.forRoot({}),
|
||||||
|
|
||||||
|
WebSocketModule.forRoot(environment.webSocketModuleConfig),
|
||||||
WebStorageModule.forRoot({}),
|
WebStorageModule.forRoot({}),
|
||||||
|
|
||||||
I18nModule.forRoot({}),
|
I18nModule.forRoot({}),
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { Component, ViewChild, OnDestroy, OnInit, Type } from '@angular/core';
|
import { Component, ViewChild, OnDestroy, OnInit, Type } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { MatTabChangeEvent } from '@angular/material/tabs';
|
import { MatTabChangeEvent } from '@angular/material/tabs';
|
||||||
import { MatSidenav } from '@angular/material/sidenav';
|
import { MatSidenav } from '@angular/material/sidenav';
|
||||||
|
|
||||||
import { Store, select } from '@ngrx/store';
|
import { Store, select } from '@ngrx/store';
|
||||||
|
|
||||||
|
import { LogService } from '@ucap/ng-logger';
|
||||||
|
|
||||||
import { AppSelector } from '@app/store/state';
|
import { AppSelector } from '@app/store/state';
|
||||||
import { Subscription } from 'rxjs';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layouts-default',
|
selector: 'app-layouts-default',
|
||||||
|
@ -22,8 +25,18 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||||
contentSectionComponent: Type<any>;
|
contentSectionComponent: Type<any>;
|
||||||
|
|
||||||
private windowSizeSubscription: Subscription;
|
private windowSizeSubscription: Subscription;
|
||||||
|
private routerEventSubscription: Subscription;
|
||||||
|
|
||||||
constructor(private router: Router, private store: Store<any>) {}
|
constructor(
|
||||||
|
private router: Router,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private store: Store<any>,
|
||||||
|
private logService: LogService
|
||||||
|
) {
|
||||||
|
this.routerEventSubscription = this.router.events.subscribe((event) => {
|
||||||
|
this.logService.debug('DefaultLayoutComponent', event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.windowSizeSubscription = this.store
|
this.windowSizeSubscription = this.store
|
||||||
|
@ -45,14 +58,32 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||||
if (!this.windowSizeSubscription) {
|
if (!this.windowSizeSubscription) {
|
||||||
this.windowSizeSubscription.unsubscribe();
|
this.windowSizeSubscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
if (!!this.routerEventSubscription) {
|
||||||
|
this.routerEventSubscription.unsubscribe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectedTabChange(event: MatTabChangeEvent) {
|
onSelectedTabChange(event: MatTabChangeEvent) {
|
||||||
switch (event.index) {
|
switch (event.index) {
|
||||||
case 1:
|
case 1:
|
||||||
// this.router.navigate(['/chat']);
|
this.router.navigate(['/chat']);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
this.router.navigate(['/organization']);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.router.navigate(['/message']);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.router.navigate(['/group']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onRoute(url: string) {
|
||||||
|
this.logService.debug('onRoute', url);
|
||||||
|
switch (url) {
|
||||||
|
case '/organization':
|
||||||
import('@app/sections/organization/organization.section.module').then(
|
import('@app/sections/organization/organization.section.module').then(
|
||||||
(m) => {
|
(m) => {
|
||||||
this.leftSectionComponent = m.TreeListSectionComponent;
|
this.leftSectionComponent = m.TreeListSectionComponent;
|
||||||
|
@ -64,11 +95,18 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case '/group':
|
||||||
// this.router.navigate(['/message']);
|
|
||||||
break;
|
break;
|
||||||
|
case '/chat':
|
||||||
|
import('@app/pages/chat/chat.page.module').then((m) => {
|
||||||
|
this.leftSectionComponent = m.RoomListPageComponent;
|
||||||
|
this.contentSectionComponent = m.IndexPageComponent;
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case '/message':
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// this.router.navigate(['/group']);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,5 @@ export interface LoginSession extends UCAPLoginSession {
|
||||||
loginPw?: string;
|
loginPw?: string;
|
||||||
initPw?: boolean;
|
initPw?: boolean;
|
||||||
encData?: string;
|
encData?: string;
|
||||||
|
alive?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,7 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { IndexPageComponent } from './components/index.page.component';
|
const routes: Routes = [];
|
||||||
import { RoomListPageComponent } from './components/room-list.page.component';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: 'index',
|
|
||||||
component: IndexPageComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'room-list',
|
|
||||||
component: RoomListPageComponent,
|
|
||||||
outlet: 'outlet-content'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
|
|
@ -5,7 +5,12 @@ import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
|
|
||||||
import { AppChatRoutingPageModule } from './chat-routing.page.module';
|
import { AppChatRoutingPageModule } from './chat-routing.page.module';
|
||||||
|
|
||||||
import { COMPONENTS } from './components';
|
import { IndexPageComponent } from './components/index.page.component';
|
||||||
|
import { RoomListPageComponent } from './components/room-list.page.component';
|
||||||
|
|
||||||
|
export const COMPONENTS = [IndexPageComponent, RoomListPageComponent];
|
||||||
|
|
||||||
|
export { IndexPageComponent, RoomListPageComponent };
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonModule, FlexLayoutModule, AppChatRoutingPageModule],
|
imports: [CommonModule, FlexLayoutModule, AppChatRoutingPageModule],
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
import { IndexPageComponent } from './index.page.component';
|
|
||||||
import { RoomListPageComponent } from './room-list.page.component';
|
|
||||||
|
|
||||||
export const COMPONENTS = [IndexPageComponent, RoomListPageComponent];
|
|
|
@ -1 +1,3 @@
|
||||||
Room list page of chat is works!
|
<div fxFlexFill>
|
||||||
|
Room list page of chat is works!
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pages-chat-room-list',
|
selector: 'app-pages-chat-room-list',
|
||||||
|
@ -6,5 +7,7 @@ import { Component } from '@angular/core';
|
||||||
styleUrls: ['./room-list.page.component.scss']
|
styleUrls: ['./room-list.page.component.scss']
|
||||||
})
|
})
|
||||||
export class RoomListPageComponent {
|
export class RoomListPageComponent {
|
||||||
constructor() {}
|
constructor(private router: Router) {
|
||||||
|
console.log('RoomListPageComponent', this.router.url, this.router);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Observable, forkJoin } from 'rxjs';
|
import { Observable, forkJoin, Subject } from 'rxjs';
|
||||||
import { take, concatMap } from 'rxjs/operators';
|
import { take, filter, map, takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
|
@ -12,9 +12,9 @@ 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';
|
||||||
import { SSOMode } from '@ucap/protocol-authentication';
|
|
||||||
|
|
||||||
import { LogService } from '@ucap/ng-logger';
|
import { LogService } from '@ucap/ng-logger';
|
||||||
|
import { SessionStorageService } from '@ucap/ng-web-storage';
|
||||||
import { UCAP_NATIVE_SERVICE } from '@ucap/ng-native';
|
import { UCAP_NATIVE_SERVICE } from '@ucap/ng-native';
|
||||||
import { PublicApiService } from '@ucap/ng-api-public';
|
import { PublicApiService } from '@ucap/ng-api-public';
|
||||||
import { ExternalApiService } from '@ucap/ng-api-external';
|
import { ExternalApiService } from '@ucap/ng-api-external';
|
||||||
|
@ -23,25 +23,22 @@ import { InnerProtocolService } from '@ucap/ng-protocol-inner';
|
||||||
import { AuthenticationProtocolService } from '@ucap/ng-protocol-authentication';
|
import { AuthenticationProtocolService } from '@ucap/ng-protocol-authentication';
|
||||||
|
|
||||||
import { CompanyActions } from '@ucap/ng-store-organization';
|
import { CompanyActions } from '@ucap/ng-store-organization';
|
||||||
import {
|
import { ConfigurationActions } from '@ucap/ng-store-authentication';
|
||||||
ConfigurationActions,
|
|
||||||
LoginActions
|
|
||||||
} from '@ucap/ng-store-authentication';
|
|
||||||
|
|
||||||
import { AppAuthenticationService } from '@app/services/app-authentication.service';
|
import { AppAuthenticationService } from '@app/services/app-authentication.service';
|
||||||
|
import { AppKey } from '@app/types/app-key.type';
|
||||||
|
import { LoginSession } from '@app/models/login-session';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppAuthenticationResolver implements Resolve<void> {
|
export class AppSessionResolver implements Resolve<void> {
|
||||||
constructor(
|
constructor(
|
||||||
private publicApiService: PublicApiService,
|
private publicApiService: PublicApiService,
|
||||||
private externalApiService: ExternalApiService,
|
private externalApiService: ExternalApiService,
|
||||||
private protocolService: ProtocolService,
|
private protocolService: ProtocolService,
|
||||||
private innerProtocolService: InnerProtocolService,
|
|
||||||
private authenticationProtocolService: AuthenticationProtocolService,
|
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
|
private sessionStorageService: SessionStorageService,
|
||||||
private appAuthenticationService: AppAuthenticationService,
|
private appAuthenticationService: AppAuthenticationService,
|
||||||
private logService: LogService,
|
private logService: LogService
|
||||||
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
resolve(
|
resolve(
|
||||||
|
@ -51,15 +48,11 @@ export class AppAuthenticationResolver implements Resolve<void> {
|
||||||
return new Promise<void>(async (resolve, reject) => {
|
return new Promise<void>(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const loginSession = this.appAuthenticationService.getLoginSession();
|
const loginSession = this.appAuthenticationService.getLoginSession();
|
||||||
const networkInfo = await this.nativeService.getNetworkInfo();
|
|
||||||
const localIp =
|
if (loginSession.alive) {
|
||||||
!!networkInfo && 0 < networkInfo.length && !!networkInfo[0].ip
|
resolve();
|
||||||
? networkInfo[0].ip
|
return;
|
||||||
: '';
|
}
|
||||||
const localMac =
|
|
||||||
!!networkInfo && 0 < networkInfo.length && !!networkInfo[0].mac
|
|
||||||
? networkInfo[0].mac
|
|
||||||
: '';
|
|
||||||
|
|
||||||
this.store.dispatch(
|
this.store.dispatch(
|
||||||
CompanyActions.companies({
|
CompanyActions.companies({
|
||||||
|
@ -128,46 +121,28 @@ export class AppAuthenticationResolver implements Resolve<void> {
|
||||||
|
|
||||||
this.protocolService
|
this.protocolService
|
||||||
.connect(versionInfo2Res.serverIp)
|
.connect(versionInfo2Res.serverIp)
|
||||||
|
.pipe(take(1))
|
||||||
|
.subscribe(
|
||||||
|
() => {
|
||||||
|
const destroy$ = new Subject<boolean>();
|
||||||
|
this.sessionStorageService.changed$
|
||||||
.pipe(
|
.pipe(
|
||||||
take(1),
|
takeUntil(destroy$),
|
||||||
concatMap(() => {
|
filter((param) => AppKey.LoginSession === param.key),
|
||||||
return this.innerProtocolService.conn({}).pipe(
|
map((param) => param.value)
|
||||||
take(1),
|
|
||||||
concatMap((connRes) => {
|
|
||||||
return this.authenticationProtocolService
|
|
||||||
.login({
|
|
||||||
loginId: loginSession.loginId,
|
|
||||||
loginPw: loginSession.loginPw,
|
|
||||||
deviceType: loginSession.deviceType,
|
|
||||||
deviceId: ' ',
|
|
||||||
token: '',
|
|
||||||
localeCode: loginSession.localeCode,
|
|
||||||
pushId: ' ',
|
|
||||||
companyCode: loginSession.companyCode,
|
|
||||||
passwordEncodingType: 1,
|
|
||||||
clientVersion: '',
|
|
||||||
reconnect: false,
|
|
||||||
ip: localIp,
|
|
||||||
hostName: localMac,
|
|
||||||
ssoMode: SSOMode.AUTH,
|
|
||||||
userSpecificInformation: 'PRO_000482',
|
|
||||||
andId: '',
|
|
||||||
andPushRefreshYn: ''
|
|
||||||
})
|
|
||||||
.pipe(take(1));
|
|
||||||
})
|
|
||||||
);
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(loginRes) => {
|
(v) => {
|
||||||
this.store.dispatch(
|
if ((v as LoginSession).alive) {
|
||||||
LoginActions.loginSuccess({
|
destroy$.next(true);
|
||||||
res: loginRes,
|
destroy$.unsubscribe();
|
||||||
loginSession
|
|
||||||
})
|
|
||||||
);
|
|
||||||
resolve();
|
resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
reject(error);
|
reject(error);
|
|
@ -1,16 +1,21 @@
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
|
|
||||||
import { LocaleCode } from '@ucap/core';
|
import { LocaleCode } from '@ucap/core';
|
||||||
|
|
||||||
import { PasswordUtil } from '@ucap/pi';
|
import { PasswordUtil } from '@ucap/pi';
|
||||||
|
import { LoginResponse, SSOMode } from '@ucap/protocol-authentication';
|
||||||
|
import { NativeService } from '@ucap/native';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SessionStorageService,
|
SessionStorageService,
|
||||||
LocalStorageService
|
LocalStorageService
|
||||||
} from '@ucap/ng-web-storage';
|
} from '@ucap/ng-web-storage';
|
||||||
import { NativeService } from '@ucap/native';
|
|
||||||
|
|
||||||
import { UCAP_NATIVE_SERVICE } from '@ucap/ng-native';
|
import { UCAP_NATIVE_SERVICE } from '@ucap/ng-native';
|
||||||
|
import { InnerProtocolService } from '@ucap/ng-protocol-inner';
|
||||||
|
import { AuthenticationProtocolService } from '@ucap/ng-protocol-authentication';
|
||||||
|
import { LoginActions } from '@ucap/ng-store-authentication';
|
||||||
|
|
||||||
import { LoginSession } from '@app/models/login-session';
|
import { LoginSession } from '@app/models/login-session';
|
||||||
import { UserStore } from '@app/models/user-store';
|
import { UserStore } from '@app/models/user-store';
|
||||||
|
@ -18,14 +23,19 @@ import { UserStore } from '@app/models/user-store';
|
||||||
import { AppKey } from '@app/types/app-key.type';
|
import { AppKey } from '@app/types/app-key.type';
|
||||||
|
|
||||||
import { environment } from '@environments';
|
import { environment } from '@environments';
|
||||||
|
import { take, concatMap } from 'rxjs/operators';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AppAuthenticationService {
|
export class AppAuthenticationService {
|
||||||
constructor(
|
constructor(
|
||||||
|
private innerProtocolService: InnerProtocolService,
|
||||||
|
private authenticationProtocolService: AuthenticationProtocolService,
|
||||||
private sessionStorageService: SessionStorageService,
|
private sessionStorageService: SessionStorageService,
|
||||||
private localStorageService: LocalStorageService,
|
private localStorageService: LocalStorageService,
|
||||||
|
private store: Store<any>,
|
||||||
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
|
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@ -147,6 +157,73 @@ export class AppAuthenticationService {
|
||||||
this.sessionStorageService.remove(AppKey.LogoutSession);
|
this.sessionStorageService.remove(AppKey.LogoutSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createSession(): Promise<{
|
||||||
|
loginRes: LoginResponse;
|
||||||
|
loginSession: LoginSession;
|
||||||
|
}> {
|
||||||
|
return new Promise<{
|
||||||
|
loginRes: LoginResponse;
|
||||||
|
loginSession: LoginSession;
|
||||||
|
}>(async (resolve, reject) => {
|
||||||
|
const loginSession = this.getLoginSession();
|
||||||
|
const networkInfo = await this.nativeService.getNetworkInfo();
|
||||||
|
const localIp =
|
||||||
|
!!networkInfo && 0 < networkInfo.length && !!networkInfo[0].ip
|
||||||
|
? networkInfo[0].ip
|
||||||
|
: '';
|
||||||
|
const localMac =
|
||||||
|
!!networkInfo && 0 < networkInfo.length && !!networkInfo[0].mac
|
||||||
|
? networkInfo[0].mac
|
||||||
|
: '';
|
||||||
|
|
||||||
|
this.innerProtocolService
|
||||||
|
.conn({})
|
||||||
|
.pipe(
|
||||||
|
take(1),
|
||||||
|
concatMap((connRes) => {
|
||||||
|
return this.authenticationProtocolService
|
||||||
|
.login({
|
||||||
|
loginId: loginSession.loginId,
|
||||||
|
loginPw: loginSession.loginPw,
|
||||||
|
deviceType: loginSession.deviceType,
|
||||||
|
deviceId: ' ',
|
||||||
|
token: '',
|
||||||
|
localeCode: loginSession.localeCode,
|
||||||
|
pushId: ' ',
|
||||||
|
companyCode: loginSession.companyCode,
|
||||||
|
passwordEncodingType: 1,
|
||||||
|
clientVersion: '',
|
||||||
|
reconnect: false,
|
||||||
|
ip: localIp,
|
||||||
|
hostName: localMac,
|
||||||
|
ssoMode: SSOMode.AUTH,
|
||||||
|
userSpecificInformation: 'PRO_000482',
|
||||||
|
andId: '',
|
||||||
|
andPushRefreshYn: ''
|
||||||
|
})
|
||||||
|
.pipe(take(1));
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.subscribe(
|
||||||
|
(loginRes) => {
|
||||||
|
this.store.dispatch(
|
||||||
|
LoginActions.loginSuccess({
|
||||||
|
res: loginRes,
|
||||||
|
loginSession
|
||||||
|
})
|
||||||
|
);
|
||||||
|
resolve({
|
||||||
|
loginSession,
|
||||||
|
loginRes
|
||||||
|
});
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
this.sessionStorageService.remove(AppKey.LoginResponse);
|
this.sessionStorageService.remove(AppKey.LoginResponse);
|
||||||
this.sessionStorageService.remove(AppKey.VerInfoResponse);
|
this.sessionStorageService.remove(AppKey.VerInfoResponse);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
|
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
import { DeviceType, DesktopType } from '@ucap/core';
|
import { DeviceType, DesktopType } from '@ucap/core';
|
||||||
import { NativeService, NativeType, OsType } from '@ucap/native';
|
import { NativeService, NativeType, OsType } from '@ucap/native';
|
||||||
|
|
||||||
|
@ -10,7 +12,10 @@ import { SessionStorageService } from '@ucap/ng-web-storage';
|
||||||
import { PingProtocolService } from '@ucap/ng-protocol-ping';
|
import { PingProtocolService } from '@ucap/ng-protocol-ping';
|
||||||
import { DateService } from '@ucap/ng-ui';
|
import { DateService } from '@ucap/ng-ui';
|
||||||
import { TranslateService } from '@ucap/ng-ui-organization';
|
import { TranslateService } from '@ucap/ng-ui-organization';
|
||||||
|
import { ProtocolService } from '@ucap/ng-protocol';
|
||||||
|
import { LoginActions } from '@ucap/ng-store-authentication';
|
||||||
|
|
||||||
|
import { AppActions } from '@app/store/actions';
|
||||||
import { environment } from '@environments';
|
import { environment } from '@environments';
|
||||||
|
|
||||||
import { AppAuthenticationService } from './app-authentication.service';
|
import { AppAuthenticationService } from './app-authentication.service';
|
||||||
|
@ -23,9 +28,11 @@ export class AppService {
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private dateService: DateService,
|
private dateService: DateService,
|
||||||
|
private protocolService: ProtocolService,
|
||||||
private pingProtocolService: PingProtocolService,
|
private pingProtocolService: PingProtocolService,
|
||||||
private appAuthenticationService: AppAuthenticationService,
|
private appAuthenticationService: AppAuthenticationService,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
|
private store: Store<any>,
|
||||||
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
|
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@ -68,7 +75,8 @@ export class AppService {
|
||||||
...loginSession,
|
...loginSession,
|
||||||
deviceType,
|
deviceType,
|
||||||
desktopType,
|
desktopType,
|
||||||
companyGroupCode: this.companyGroupCode
|
companyGroupCode: this.companyGroupCode,
|
||||||
|
alive: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.dateService.setDefaultTimezone('Asia/Seoul');
|
this.dateService.setDefaultTimezone('Asia/Seoul');
|
||||||
|
@ -138,6 +146,35 @@ export class AppService {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.all([initSession, initI18n, initOrganization]);
|
const initProtocol = new Promise<void>(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
|
this.protocolService.connection$.subscribe((connected) => {
|
||||||
|
if (connected) {
|
||||||
|
this.appAuthenticationService
|
||||||
|
.createSession()
|
||||||
|
.then((result) => {
|
||||||
|
this.store.dispatch(
|
||||||
|
LoginActions.sessionCreated({
|
||||||
|
res: result.loginRes,
|
||||||
|
loginSession: result.loginSession
|
||||||
|
})
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((reason) => {
|
||||||
|
this.logService.error('createSession failed', reason);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.store.dispatch(
|
||||||
|
LoginActions.sessionDestroyed({ error: 'disconnected' })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
resolve();
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return Promise.all([initSession, initI18n, initOrganization, initProtocol]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { LoginActions } from '@ucap/ng-store-authentication';
|
||||||
|
|
||||||
import { AppKey } from '@app/types/app-key.type';
|
import { AppKey } from '@app/types/app-key.type';
|
||||||
import { AppAuthenticationService } from '@app/services/app-authentication.service';
|
import { AppAuthenticationService } from '@app/services/app-authentication.service';
|
||||||
|
import { AppActions } from '@app/store/actions';
|
||||||
|
|
||||||
import { environment } from '@environments';
|
import { environment } from '@environments';
|
||||||
|
|
||||||
|
@ -119,6 +120,28 @@ export class Effects {
|
||||||
{ dispatch: false }
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sessionCreated$ = createEffect(
|
||||||
|
() =>
|
||||||
|
this.actions$.pipe(
|
||||||
|
ofType(LoginActions.sessionCreated),
|
||||||
|
tap((params) => {
|
||||||
|
this.appAuthenticationService.setLoginSession({ alive: true });
|
||||||
|
})
|
||||||
|
),
|
||||||
|
{ dispatch: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
sessionDestroyed$ = createEffect(
|
||||||
|
() =>
|
||||||
|
this.actions$.pipe(
|
||||||
|
ofType(LoginActions.sessionDestroyed),
|
||||||
|
tap((params) => {
|
||||||
|
this.appAuthenticationService.setLoginSession({ alive: false });
|
||||||
|
})
|
||||||
|
),
|
||||||
|
{ dispatch: false }
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private actions$: Actions,
|
private actions$: Actions,
|
||||||
private sessionStorageService: SessionStorageService,
|
private sessionStorageService: SessionStorageService,
|
||||||
|
|
|
@ -154,6 +154,12 @@ export const environment: Environment = {
|
||||||
urls: piUrls
|
urls: piUrls
|
||||||
},
|
},
|
||||||
|
|
||||||
|
webSocketModuleConfig: {
|
||||||
|
reconnect: {
|
||||||
|
delay: 1000 * 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
protocolModuleConfig: {
|
protocolModuleConfig: {
|
||||||
hostConfig: {
|
hostConfig: {
|
||||||
protocol: 'ws',
|
protocol: 'ws',
|
||||||
|
@ -161,9 +167,6 @@ export const environment: Environment = {
|
||||||
port: 8080
|
port: 8080
|
||||||
},
|
},
|
||||||
urls: protocolUrls,
|
urls: protocolUrls,
|
||||||
reconnect: {
|
|
||||||
delay: 1000
|
|
||||||
},
|
|
||||||
requestId: {
|
requestId: {
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 59999
|
max: 59999
|
||||||
|
@ -175,6 +178,6 @@ export const environment: Environment = {
|
||||||
},
|
},
|
||||||
pingProtocolModuleConfig: {
|
pingProtocolModuleConfig: {
|
||||||
statusCode: 'O',
|
statusCode: 'O',
|
||||||
interval: 5 * 60
|
interval: 5
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -154,6 +154,12 @@ export const environment: Environment = {
|
||||||
urls: piUrls
|
urls: piUrls
|
||||||
},
|
},
|
||||||
|
|
||||||
|
webSocketModuleConfig: {
|
||||||
|
reconnect: {
|
||||||
|
delay: 1000 * 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
protocolModuleConfig: {
|
protocolModuleConfig: {
|
||||||
hostConfig: {
|
hostConfig: {
|
||||||
protocol: 'ws',
|
protocol: 'ws',
|
||||||
|
@ -161,9 +167,6 @@ export const environment: Environment = {
|
||||||
port: 8080
|
port: 8080
|
||||||
},
|
},
|
||||||
urls: protocolUrls,
|
urls: protocolUrls,
|
||||||
reconnect: {
|
|
||||||
delay: 1000
|
|
||||||
},
|
|
||||||
requestId: {
|
requestId: {
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 59999
|
max: 59999
|
||||||
|
|
|
@ -157,6 +157,12 @@ export const environment: Environment = {
|
||||||
urls: piUrls
|
urls: piUrls
|
||||||
},
|
},
|
||||||
|
|
||||||
|
webSocketModuleConfig: {
|
||||||
|
reconnect: {
|
||||||
|
delay: 1000 * 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
protocolModuleConfig: {
|
protocolModuleConfig: {
|
||||||
hostConfig: {
|
hostConfig: {
|
||||||
protocol: 'ws',
|
protocol: 'ws',
|
||||||
|
@ -164,9 +170,6 @@ export const environment: Environment = {
|
||||||
port: 8080
|
port: 8080
|
||||||
},
|
},
|
||||||
urls: protocolUrls,
|
urls: protocolUrls,
|
||||||
reconnect: {
|
|
||||||
delay: 1000
|
|
||||||
},
|
|
||||||
requestId: {
|
requestId: {
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 59999
|
max: 59999
|
||||||
|
|
|
@ -2,6 +2,8 @@ import { Type } from '@angular/core';
|
||||||
|
|
||||||
import { DeviceType, DesktopType } from '@ucap/core';
|
import { DeviceType, DesktopType } from '@ucap/core';
|
||||||
|
|
||||||
|
import { ModuleConfig as WebSocketModuleConfig } from '@ucap/web-socket';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ModuleConfig as CommonApiModuleConfig,
|
ModuleConfig as CommonApiModuleConfig,
|
||||||
Urls as CommonApiUrls
|
Urls as CommonApiUrls
|
||||||
|
@ -114,6 +116,7 @@ export interface Environment {
|
||||||
messageApiModuleConfig: MessageApiModuleConfig;
|
messageApiModuleConfig: MessageApiModuleConfig;
|
||||||
promptApiModuleConfig: PromptApiModuleConfig;
|
promptApiModuleConfig: PromptApiModuleConfig;
|
||||||
piModuleConfig: PiModuleConfig;
|
piModuleConfig: PiModuleConfig;
|
||||||
|
webSocketModuleConfig: WebSocketModuleConfig;
|
||||||
protocolModuleConfig: ProtocolModuleConfig;
|
protocolModuleConfig: ProtocolModuleConfig;
|
||||||
pingProtocolModuleConfig: PingProtocolModuleConfig;
|
pingProtocolModuleConfig: PingProtocolModuleConfig;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user