本文整理匯總了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;
}