Redirect all unexpected url to 404 view

This commit is contained in:
Bubka 2020-01-11 17:25:37 +01:00
parent 0894b3fd25
commit f47e7cdf47
2 changed files with 11 additions and 7 deletions

14
resources/js/app.js vendored
View File

@ -48,6 +48,12 @@ const router = new VueRouter({
name: 'edit',
component: Edit,
},
{
path: '/error',
name: 'GenericError',
component: NotFound,
props: true
},
{
path: '/404',
name: '404',
@ -55,11 +61,9 @@ const router = new VueRouter({
props: true
},
{
path: '/error',
name: 'GenericError',
component: NotFound,
props: true
},
path: '*',
redirect: { name: '404' }
}
],
});

View File

@ -10,7 +10,7 @@
<p>An error occured, please <router-link :to="{ name: 'accounts' }" class="is-text has-text-white">refresh</router-link></p>
</div>
<div v-if="debugMode == 'development'">
<p class="debug">
<p v-if="debug" class="debug">
<code>
{{ debug }}
</code>
@ -28,7 +28,7 @@
data(){
return {
ShowModal : true,
debug : this.err.data,
debug : this.err ? this.err.data : null,
}
},