stash
This commit is contained in:
parent
6248a7ef2f
commit
0b46fb152c
3 changed files with 93 additions and 0 deletions
55
frontend/src/components/AuthenticatedImage.vue
Normal file
55
frontend/src/components/AuthenticatedImage.vue
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--img src=""-->
|
||||
data:{{ image_data }}<br>
|
||||
owner:{{ owner }}<br>
|
||||
src:{{ src }}<br>
|
||||
servers:{{ servers }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
img {
|
||||
width: 190px;
|
||||
height: 107px;
|
||||
object-fit: contain;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {mapActions, mapGetters} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "AuthenticatedImage",
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
owner: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
image_data: "",
|
||||
servers: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["signAuth"])
|
||||
},
|
||||
methods: {
|
||||
...mapActions(["getFriendServers"])
|
||||
},
|
||||
async mounted() {
|
||||
try {
|
||||
this.servers = await this.getFriendServers({username: this.owner});
|
||||
this.image_data = await this.servers.get(this.signAuth, this.src);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue