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', name: 'edit',
component: Edit, component: Edit,
}, },
{
path: '/error',
name: 'GenericError',
component: NotFound,
props: true
},
{ {
path: '/404', path: '/404',
name: '404', name: '404',
@ -55,11 +61,9 @@ const router = new VueRouter({
props: true props: true
}, },
{ {
path: '/error', path: '*',
name: 'GenericError', redirect: { name: '404' }
component: NotFound, }
props: true
},
], ],
}); });

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