add page not found catch all

This commit is contained in:
Gauthier Roebroeck 2025-10-17 09:49:38 +08:00
parent 91c1eeb9c4
commit 40faf6717f
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,38 @@
<template>
<v-empty-state
icon="i-mdi:help-circle"
color="warning"
:title="
$formatMessage({
description: 'Page not found view: error message title',
defaultMessage: 'Page not found',
id: '6WDISV',
})
"
:text="
$formatMessage({
description: 'Page not found view: error message subtitle',
defaultMessage: 'You will be redirected to the home page',
id: '5b2A0u',
})
"
/>
</template>
<script lang="ts" setup>
import { useCountdown } from '@vueuse/core'
const router = useRouter()
useCountdown(5, {
onComplete() {
void router.push('/')
},
}).start()
</script>
<route lang="yaml">
meta:
layout: single
noAuth: true
</route>

View file

@ -19,6 +19,7 @@ declare module 'vue-router/auto-routes' {
*/
export interface RouteNamedMap {
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
'/[...path]': RouteRecordInfo<'/[...path]', '/:path(.*)', { path: ParamValue<true> }, { path: ParamValue<false> }>,
'/account/activity': RouteRecordInfo<'/account/activity', '/account/activity', Record<never, never>, Record<never, never>>,
'/account/api-keys': RouteRecordInfo<'/account/api-keys', '/account/api-keys', Record<never, never>, Record<never, never>>,
'/account/details': RouteRecordInfo<'/account/details', '/account/details', Record<never, never>, Record<never, never>>,
@ -58,6 +59,10 @@ declare module 'vue-router/auto-routes' {
routes: '/'
views: never
}
'src/pages/[...path].vue': {
routes: '/[...path]'
views: never
}
'src/pages/account/activity.vue': {
routes: '/account/activity'
views: never