stash
This commit is contained in:
parent
0b46fb152c
commit
a7515d366c
3 changed files with 8 additions and 17 deletions
|
|
@ -1,11 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--img src=""-->
|
||||
data:{{ image_data }}<br>
|
||||
owner:{{ owner }}<br>
|
||||
src:{{ src }}<br>
|
||||
servers:{{ servers }}
|
||||
</div>
|
||||
<img :src="image_data" :alt="owner + '/' + src"/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
@ -46,7 +40,9 @@ export default {
|
|||
async mounted() {
|
||||
try {
|
||||
this.servers = await this.getFriendServers({username: this.owner});
|
||||
this.image_data = await this.servers.get(this.signAuth, this.src);
|
||||
const response = await this.servers.getRaw(this.signAuth, this.src);
|
||||
const mime_type = response.headers.get("content-type");
|
||||
this.image_data = "data:" + mime_type + ";base64," + btoa(String.fromCharCode(...new Uint8Array(await response.arrayBuffer())));
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue