|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
import { registerLocaleData } from '@angular/common';
|
|
|
|
|
import { Injector } from '@angular/core';
|
|
|
|
|
import { OAuthService } from 'angular-oauth2-oidc';
|
|
|
|
|
import { tap } from 'rxjs/operators';
|
|
|
|
|
import { tap, catchError } from 'rxjs/operators';
|
|
|
|
|
import { throwError } from 'rxjs';
|
|
|
|
|
import { ABP } from '../models/common';
|
|
|
|
|
import { Environment } from '../models/environment';
|
|
|
|
|
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
|
|
|
|
@ -12,6 +13,7 @@ import { EnvironmentService } from '../services/environment.service';
|
|
|
|
|
import { SessionStateService } from '../services/session-state.service';
|
|
|
|
|
import { clearOAuthStorage } from '../strategies/auth-flow.strategy';
|
|
|
|
|
import { CORE_OPTIONS } from '../tokens/options.token';
|
|
|
|
|
import { APP_CONFIG_INITIALIZATION_ERROR } from '../tokens/app-config.token';
|
|
|
|
|
import { getRemoteEnv } from './environment-utils';
|
|
|
|
|
import { parseTenantFromUrl } from './multi-tenancy-utils';
|
|
|
|
|
|
|
|
|
@ -38,6 +40,14 @@ export function getInitialData(injector: Injector) {
|
|
|
|
|
const currentTenant = configState.getOne('currentTenant') as CurrentTenantDto;
|
|
|
|
|
injector.get(SessionStateService).setTenant(currentTenant);
|
|
|
|
|
}),
|
|
|
|
|
catchError(error => {
|
|
|
|
|
const appConfig = injector.get(APP_CONFIG_INITIALIZATION_ERROR);
|
|
|
|
|
if (appConfig && appConfig.length) {
|
|
|
|
|
appConfig.forEach(fn => fn(error));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return throwError(error);
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
.toPromise();
|
|
|
|
|
};
|
|
|
|
|