當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript auth.service.AuthService類代碼示例

本文整理匯總了TypeScript中@eg/core/auth.service.AuthService的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.AuthService類的具體用法?TypeScript service.AuthService怎麽用?TypeScript service.AuthService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了service.AuthService類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

    constructor(
        private router: Router,
        private pcrud: PcrudService,
        private auth: AuthService,
        private org: OrgService) {

        this.gridSource = new GridDataSource();
        this.contextOrg = this.org.get(this.auth.user().ws_ou());

        this.gridSource.getRows = (pager: Pager) => {
            const orgs = this.org.ancestors(this.contextOrg, true);
            return this.pcrud.search('vms', {owner: orgs}, {
                order_by: {vms: ['name']},
                limit: pager.limit,
                offset: pager.offset
            });
        };

        this.createNew = () => {
            this.editDialog.mode = 'create';
            this.editDialog.open({size: 'lg'}).then(
                ok => this.grid.reload(),
                err => {}
            );
        };

        this.deleteSelected = (matchSets: IdlObject[]) => {
            matchSets.forEach(matchSet => matchSet.isdeleted(true));
            this.pcrud.autoApply(matchSets).subscribe(
                val => console.debug('deleted: ' + val),
                err => {},
                ()  => this.grid.reload()
            );
        };
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:35,代碼來源:match-set-list.component.ts

示例2: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype(this.bucketType);

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                // make it find-able to the queue-add method which
                // requires the bucket name.
                bucket.id(bktId);
                this.buckets.push(bucket);
                this.addToBucket(bktId);
            }
        });
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:26,代碼來源:record-bucket-dialog.component.ts

示例3: saveTree

    // Server API deletes and recreates the tree on update.
    // It manages parent/child relationships via the children array.
    // We only need send the current tree in a form the API recognizes.
    saveTree(): Promise<any> {


        const compileTree = (node?: TreeNode) => {

            if (!node) { node = this.tree.rootNode; }

            const point = node.callerData.point;

            node.children.forEach(child =>
                point.children().push(compileTree(child)));

            return point;
        };

        const rootPoint: IdlObject = compileTree();

        return this.net.request(
            'open-ils.vandelay',
            'open-ils.vandelay.match_set.update',
            this.auth.token(), this.matchSet_.id(), rootPoint
        ).toPromise().then(
            ok => this.refreshTree(),
            err => console.error(err)
        );
    }
開發者ID:evergreen-library-system,項目名稱:Evergreen,代碼行數:29,代碼來源:match-set-expression.component.ts

示例4:

 this.basket.getRecordIds().then(ids => {
     this.net.request(
         'open-ils.search',
         'open-ils.search.biblio.record.email',
         this.auth.token(), ids
     ).toPromise(); // fire-and-forget
 });
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:7,代碼來源:basket-actions.component.ts

示例5:

 hasPerms => {
     this.auth.verifyWorkstation().then(
         wsOk => {
             this.loadStartupData()
             .then(ok => this.observer.complete());
         },
         wsNotOk => this.handleInvalidWorkstation(path)
     );
 },
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:9,代碼來源:resolver.service.ts

示例6: fetchHold

    fetchHold() {
        if (!this._holdId) { return; }

        this.net.request(
            'open-ils.circ',
            'open-ils.circ.hold.wide_hash.stream',
            this.auth.token(), {id: this._holdId}
        ).subscribe(wideHold => {
            this.hold = wideHold;
        });
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:11,代碼來源:detail.component.ts

示例7: deleteNext

            const deleteNext = (idx: number) => {
                const queue = selected[idx];
                if (!queue) {
                    this.currentGrid().reload();
                    return Promise.resolve();
                }

                return this.net.request('open-ils.vandelay',
                    method, this.auth.token(), queue.id()
                ).toPromise().then(() => deleteNext(++idx));
            };
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:11,代碼來源:queue-list.component.ts

示例8:

 this.gridSource.getRows = (pager: Pager) => {
     return this.net.request(
         'open-ils.vandelay',
         'open-ils.vandelay.import_item.queue.retrieve',
         this.auth.token(), this.queueId, {
             with_import_error: this.filterImportErrors,
             offset: pager.offset,
             limit: pager.limit
         }
     );
 };
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:11,代碼來源:queue-items.component.ts

示例9: getItemImportDefs

    getItemImportDefs(): Promise<IdlObject[]> {
        if (this.importItemAttrDefs) {
            return Promise.resolve(this.importItemAttrDefs);
        }

        const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
        return this.pcrud.search('viiad', {owner: owners}, {}, {atomic: true})
        .toPromise().then(defs => {
            this.importItemAttrDefs = defs;
            return defs;
        });
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:12,代碼來源:vandelay.service.ts

示例10: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype('staff_client');

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                this.addToBucket(bktId);
            }
        });
    }
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:22,代碼來源:record-bucket-dialog.component.ts


注:本文中的@eg/core/auth.service.AuthService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。