0
Ich versuche, ein Profilbild von der Microsoft Azure-API abzurufen. Der folgende Code zeigt, wie.Abrufen von Foto aus Azure mit Graph API
private getProfilePicture(bearerToken: string, tenantId: string): void {
let command = CommandHelper.createRestBlobCommand([
{ name: 'https://graph.microsoft.com/beta'},
{ name: 'me/photo/$value' }
]);
command.Headers.push({ name: 'Authorization', value: 'bearer ' + bearerToken });
// load the photo from graph api.
this._gateway.send(command).subscribe(result => {
let info = result.payload;
var Base64 = require('js-base64').Base64;
var temp = 'data:image/bmp;base64,' + Base64.encode('info');
console.log(temp);
let action = actions.AuthenticationActions.photoLoaded(info);
this._store.dispatch(action);
});
}
Das Problem ist jedoch, dass, wenn ich am Ausgang schauen sie zurück:
data:image/bmp;base64,W29iamVjdCBCbG9iXQ==
die auf [Objekt Blob] übersetzt.
Meine Frage ist, wie Sie das Bildobjekt hier bekommen?
dies ist die Bildquelle ohne Stelle. Wenn Sie das Objekt rechts klicken und speichern möchten als ... –
headmax, wie sollte das im Code getan werden? –