-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathConfirmation.vue
86 lines (77 loc) · 1.95 KB
/
Confirmation.vue
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
78
79
80
81
82
83
84
85
86
<template>
<div class="confirmation">
<b-row class="breadcrumbs" no-gutters>
<b-col cols="12">
<b-breadcrumb :items="breadcrumbs" />
</b-col>
</b-row>
<b-row>
<b-col cols="8" offset="2" align="center">
<h5 :class="status">{{ message }}</h5>
<router-link :to="{ name: 'UserAuthentication' }" key="authentication" v-if="status === 'success'">
Войти
<i class="fa fa-long-arrow-right align-middle" aria-hidden="true" />
</router-link>
</b-col>
</b-row>
</div>
</template>
<script>
import apiSettings from '@/settings/api'
export default {
data() {
return {
breadcrumbs: [
{
text: 'Главная',
href: this.$router.resolve({ name: 'Mainpage' }).href
}, {
text: 'Подтверждение емэйла',
active: true
}
],
message: '',
status: 'failure'
}
},
created() {
this.confirmEmail(this.$router.currentRoute.params.token)
},
metaInfo: {
title: 'Подтверждение емэйла'
},
methods: {
confirmEmail: function(token) {
this.$http.post(apiSettings.endpointEmailConfirmation(token))
.then(response => {
this.status = 'success'
this.message = response.data.data
})
.catch(error => {
this.status = 'failure'
this.message = `Ошибка подтверждения: ${error.response.data.error.message.toLowerCase()}`
})
}
}
}
</script>
<style lang="scss" scoped>
@import '~scss/_variables';
.breadcrumbs {
.breadcrumb {
background-color: transparent;
margin-top: 4%;
padding-left: 0;
padding-top: 0;
.active {
color: $color-gray-dark;
}
}
}
.failure {
color: $color-red;
}
.success {
color: $color-green;
}
</style>