当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript abp.Abp.multiTenancy类代码示例

本文整理汇总了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();
        // });
    }
开发者ID:staneee,项目名称:ABPTemplateUI-ng-alain,代码行数:30,代码来源:AppPreBootstrap.ts

示例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();
        });
开发者ID:staneee,项目名称:ABPTemplateUI-ng-alain,代码行数:26,代码来源:AppPreBootstrap.ts

示例3: changeTenantIfNeeded

    changeTenantIfNeeded(tenantId?: number): boolean {
        if (this.isCurrentTenant(tenantId)) {
            return false;
        }

        Abp.multiTenancy.setTenantIdCookie(tenantId);
        location.reload();
        return true;
    }
开发者ID:staneee,项目名称:ABPTemplateUI-ng-alain,代码行数:9,代码来源:app-session.service.ts

示例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();
        // });
    }
开发者ID:staneee,项目名称:ABPTemplateUI-ng-alain,代码行数:64,代码来源:AppPreBootstrap.ts


注:本文中的@shared/abp-ex/abp.Abp.multiTenancy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。