本文整理汇总了TypeScript中@eg/core/auth.service.AuthService.token方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.AuthService.token方法的具体用法?TypeScript service.AuthService.token怎么用?TypeScript service.AuthService.token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@eg/core/auth.service.AuthService
的用法示例。
在下文中一共展示了service.AuthService.token方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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)
);
}
示例2:
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
});
示例3: 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);
}
});
}
示例4: 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;
});
}
示例5: 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));
};
示例6:
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
}
);
};
示例7:
this.onOpen$.subscribe(ok => {
// Reset data on dialog open
this.selectedBucket = null;
this.newBucketName = '';
this.newBucketDesc = '';
this.net.request(
'open-ils.actor',
'open-ils.actor.container.retrieve_by_class.authoritative',
this.auth.token(), this.auth.user().id(),
'biblio', 'staff_client'
).subscribe(buckets => this.buckets = buckets);
});
示例8: getBibBuckets
getBibBuckets(): Promise<IdlObject[]> {
if (this.bibBuckets) {
return Promise.resolve(this.bibBuckets);
}
return this.net.request(
'open-ils.actor',
'open-ils.actor.container.retrieve_by_class',
this.auth.token(), this.auth.user().id(), 'biblio', 'staff_client'
).toPromise().then(bkts => {
this.bibBuckets = bkts;
return bkts;
});
}
示例9: placeHold
placeHold(request: HoldRequest): Observable<HoldRequest> {
let method = 'open-ils.circ.holds.test_and_create.batch';
if (request.override) { method = method + '.override'; }
return this.net.request(
'open-ils.circ', method, this.auth.token(), {
patronid: request.recipient,
pickup_lib: request.pickupLib,
hold_type: request.holdType,
email_notify: request.notifyEmail,
phone_notify: request.notifyPhone,
thaw_date: request.thawDate,
frozen: request.frozen,
sms_notify: request.notifySms,
sms_carrier: request.smsCarrier,
holdable_formats_map: request.holdableFormats
},
[request.holdTarget]
).pipe(map(
resp => {
let result = resp.result;
const holdResult: HoldRequestResult = {success: true};
// API can return an ID, an array of events, or a hash
// of info.
if (Number(result) > 0) {
// On success, the API returns the hold ID.
holdResult.holdId = result;
console.debug(`Hold successfully placed ${result}`);
} else {
holdResult.success = false;
console.info('Hold request failed: ', result);
if (Array.isArray(result)) { result = result[0]; }
if (this.evt.parse(result)) {
holdResult.evt = this.evt.parse(result);
} else {
holdResult.evt = this.evt.parse(result.last_event);
}
}
request.result = holdResult;
return request;
}
));
}
示例10: loadQueues
loadQueues(pager: Pager): Observable<any> {
if (!this.queueType) {
return of();
}
const qtype = this.queueType.match(/bib/) ? 'bib' : 'authority';
const method = `open-ils.vandelay.${qtype}_queue.owner.retrieve`;
return this.net.request('open-ils.vandelay',
method, this.auth.token(), null, null,
{offset: pager.offset, limit: pager.limit}
);
}