2020-01-10 00:07:37 +01:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<modal v-model="ShowModal">
|
2020-01-10 10:25:29 +01:00
|
|
|
<div v-if="$route.name == '404'">
|
|
|
|
<p class="error-404"></p>
|
|
|
|
<p>Resource not found, please <router-link :to="{ name: 'accounts' }" class="is-text has-text-white">refresh</router-link></p>
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
|
|
|
<p class="error-generic"></p>
|
|
|
|
<p>An error occured, please <router-link :to="{ name: 'accounts' }" class="is-text has-text-white">refresh</router-link></p>
|
2020-01-10 00:07:37 +01:00
|
|
|
</div>
|
2020-01-10 15:00:55 +01:00
|
|
|
<div v-if="debugMode == 'development'">
|
|
|
|
<p class="debug">
|
|
|
|
<code>
|
|
|
|
{{ debug }}
|
|
|
|
</code>
|
|
|
|
</p>
|
|
|
|
</div>
|
2020-01-10 00:07:37 +01:00
|
|
|
</modal>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Modal from '../components/Modal'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data(){
|
|
|
|
return {
|
2020-01-10 15:00:55 +01:00
|
|
|
ShowModal : true,
|
|
|
|
debug : this.err.data,
|
2020-01-10 00:07:37 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-01-10 15:00:55 +01:00
|
|
|
computed: {
|
|
|
|
debugMode: function() {
|
|
|
|
return process.env.NODE_ENV
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
props: ['err'],
|
|
|
|
|
2020-01-10 00:07:37 +01:00
|
|
|
components: {
|
|
|
|
Modal
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted(){
|
|
|
|
// stop OTP generation on modal close
|
|
|
|
this.$on('modalClose', function() {
|
|
|
|
this.$router.push({name: 'accounts' });
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
|
if ( ! localStorage.getItem('jwt')) {
|
|
|
|
return next('login')
|
|
|
|
}
|
|
|
|
|
|
|
|
next()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|