Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ const router = createRouter({

...appRoutes,
NO_PERMISSION,
{
path: '/:pathMatch(.*)',
component: import('@/views/notFound/index.vue'),
},
],
scrollBehavior() {
return { top: 0 };
Expand Down
21 changes: 21 additions & 0 deletions src/views/notFound/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<a-result
status="404"
:subtitle="$t('Page not found.')"
class="h-screen flex flex-col justify-center"
>
<template #extra>
<a-space>
<a-button type="primary" @click="router.replace('/')">
返回主页
</a-button>
</a-space>
</template>
</a-result>
</template>

<script setup lang="ts">
import router from '@/router';
</script>

<style scoped lang="less"></style>