本文整理汇总了TypeScript中@kyma-project/luigi-client.getEventData函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getEventData函数的具体用法?TypeScript getEventData怎么用?TypeScript getEventData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getEventData函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: upload
public upload(url: string, fileContents: string[]) {
const token = LuigiClient.getEventData().idToken;
const observables = [];
_.each(fileContents, c => {
observables.push(
this.httpClient.post(url, c, {
headers: new HttpHeaders()
.set('Authorization', `Bearer ${token}`)
.set('Content-Type', 'application/json')
})
);
});
return forkJoin(observables);
}
示例2: intercept
intercept(
request: HttpRequest<any>,
next: HttpHandler
): Observable<HttpEvent<any>> {
if (!request.url.startsWith(AppConfig.authIssuer)) {
const token = LuigiClient.getEventData().idToken;
request = request.clone({
setHeaders: {
Authorization: `Bearer ${token}`
}
});
}
return next.handle(request).pipe(
tap(
(event: HttpEvent<any>) => {},
(err: any) => {
return err;
}
)
);
}
示例3: ngOnInit
ngOnInit() {
this.showBoundServices =
this.luigiClientService.hasBackendModule('servicecatalogaddons') &&
!LuigiClient.getEventData().isSystemNamespace;
}