Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<template>
<v-container>
<v-dialog width="500" v-model="opened">
<v-card>
<v-card-title>{{user.nickname}}</v-card-title>
<v-card-subtitle>{{user.email}}</v-card-subtitle>
<v-card-text v-html="user.status"></v-card-text>
</v-card>
</v-dialog>
<v-snackbar
v-model="snackbar.opened"
:timeout="snackbar.timeout"
:color="snackbarColor"
>{{ snackbar.text }}
</v-snackbar>
</v-container>
</template>
<script>
import client from "../../services/Client";
export default {
name: 'ProfileViwer',
data: ()=>({
script: `
<div>Hier komm ein Bild mit Script:
<img width="40px" height="40px" src="/a.png" onerror="
console.log('bild');
window.open('/we_tasks/task14/maliciousSite.html');
">
</div>`,
opened: false,
snackbar: {
opened: false,
timeout: 3000,
success: false,
text: "",
},
user: {
accountname: '',
nickname: '',
email: '',
status: ''
}
}),
methods: {
showProfile: function(accountname){
let payload = new FormData();
payload.append("accountname", accountname);
client.post(client.URLs.profile, payload).then((result)=>{
if (result.success){
this.opened = true;
this.user = result.user;
} else {
this.snackbar.success = result.success;
this.snackbar.text = result.message;
this.snackbar.opened = true;
this.opened = false;
}
});
}
},
computed: {
snackbarColor: function() {
return this.snackbar.success ? "success" : "error";
},
},
}
</script>
<style>
</style>