當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。