本文整理汇总了TypeScript中@shared/abp-ex/abp.Abp.multiTenancy类的典型用法代码示例。如果您正苦于以下问题:TypeScript Abp.multiTenancy类的具体用法?TypeScript Abp.multiTenancy怎么用?TypeScript Abp.multiTenancy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Abp.multiTenancy类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getApplicationConfig
private static getApplicationConfig(injector: Injector, callback: () => void) {
let httpClient: HttpClient = injector.get(HttpClient);
let requestHeaders = {};
if(Abp.multiTenancy.getTenantIdCookie()){
requestHeaders['Abp.TenantId'] = Abp.multiTenancy.getTenantIdCookie().toString();
}
httpClient.get<any>('/assets/appconfig.json', {
headers: requestHeaders
}).subscribe(result=>{
AppConsts.appBaseUrl = result.appBaseUrl;
AppConsts.remoteServiceBaseUrl = result.remoteServiceBaseUrl;
callback();
});
// return abp.ajax({
// url: '/assets/appconfig.json',
// method: 'GET',
// headers: {
// 'Abp.TenantId': abp.multiTenancy.getTenantIdCookie()
// }
// }).done(result => {
// AppConsts.appBaseUrl = result.appBaseUrl;
// AppConsts.remoteServiceBaseUrl = result.remoteServiceBaseUrl;
// callback();
// });
}
示例2: callback
}).subscribe(res=>{
let result = res.result;
// $.extend(true, Abp, result);
console.log('AbpUserConfiguration: %o', result);
Abp.multiTenancy.setGlobal(result.multiTenancy);
Abp.session.setGlobal(result.session);
Abp.localization.setGlobal(result.localization);
Abp.features.setGlobal(result.features);
Abp.auth.setGlobal(result.auth);
Abp.nav.setGlobal(result.nav);
Abp.setting.setGlobal(result.setting);
Abp.clock.setGloabl(result.clock);
Abp.timing.setGloabl(result.timing);
Abp.clock.provider = this.getCurrentClockProvider(result.clock.provider);
moment.locale(Abp.localization.currentLanguage.name);
if (Abp.clock.provider.supportsMultipleTimezone) {
moment.tz.setDefault(Abp.timing.timeZoneInfo.iana.timeZoneId);
}
callback();
});
示例3: changeTenantIfNeeded
changeTenantIfNeeded(tenantId?: number): boolean {
if (this.isCurrentTenant(tenantId)) {
return false;
}
Abp.multiTenancy.setTenantIdCookie(tenantId);
location.reload();
return true;
}
示例4: getUserConfiguration
private static getUserConfiguration(injector: Injector, callback: () => void) {
let httpClient: HttpClient = injector.get(HttpClient);
let requestHeaders = {
Authorization: 'Bearer ' + Abp.auth.getToken()
};
if(Abp.multiTenancy.getTenantIdCookie()){
requestHeaders['Abp.TenantId'] = Abp.multiTenancy.getTenantIdCookie().toString();
}
if(Abp.utils.getCookieValue("Abp.Localization.CultureName")){
requestHeaders['.AspNetCore.Culture'] = Abp.utils.getCookieValue("Abp.Localization.CultureName");
}
httpClient.get<any>(AppConsts.remoteServiceBaseUrl + '/AbpUserConfiguration/GetAll', {
headers: requestHeaders
}).subscribe(res=>{
let result = res.result;
// $.extend(true, Abp, result);
console.log('AbpUserConfiguration: %o', result);
Abp.multiTenancy.setGlobal(result.multiTenancy);
Abp.session.setGlobal(result.session);
Abp.localization.setGlobal(result.localization);
Abp.features.setGlobal(result.features);
Abp.auth.setGlobal(result.auth);
Abp.nav.setGlobal(result.nav);
Abp.setting.setGlobal(result.setting);
Abp.clock.setGloabl(result.clock);
Abp.timing.setGloabl(result.timing);
Abp.clock.provider = this.getCurrentClockProvider(result.clock.provider);
moment.locale(Abp.localization.currentLanguage.name);
if (Abp.clock.provider.supportsMultipleTimezone) {
moment.tz.setDefault(Abp.timing.timeZoneInfo.iana.timeZoneId);
}
callback();
});
// return abp.ajax({
// url: AppConsts.remoteServiceBaseUrl + '/AbpUserConfiguration/GetAll',
// method: 'GET',
// headers: {
// Authorization: 'Bearer ' + abp.auth.getToken(),
// '.AspNetCore.Culture': abp.utils.getCookieValue("Abp.Localization.CultureName"),
// 'Abp.TenantId': abp.multiTenancy.getTenantIdCookie()
// }
// }).done(result => {
// $.extend(true, abp, result);
// abp.clock.provider = this.getCurrentClockProvider(result.clock.provider);
// moment.locale(abp.localization.currentLanguage.name);
// if (abp.clock.provider.supportsMultipleTimezone) {
// moment.tz.setDefault(abp.timing.timeZoneInfo.iana.timeZoneId);
// }
// callback();
// });
}