Add Error Page
This commit is contained in:
parent
665611aad7
commit
1dc1385a0f
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
@ -40,25 +40,53 @@ export const basicRoutes = [
|
|||||||
meta: { order: 99 },
|
meta: { order: 99 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '403',
|
name: 'ErrorPage',
|
||||||
path: '/403',
|
path: '/error-page',
|
||||||
component: () => import('@/views/error-page/403.vue'),
|
component: Layout,
|
||||||
isHidden: true,
|
redirect: '/error-page/404',
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '404',
|
|
||||||
path: '/404',
|
|
||||||
component: () => import('@/views/error-page/404.vue'),
|
|
||||||
isHidden: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Login',
|
|
||||||
path: '/login',
|
|
||||||
component: () => import('@/views/login/index.vue'),
|
|
||||||
isHidden: true,
|
|
||||||
meta: {
|
meta: {
|
||||||
title: '登录页',
|
title: '错误页',
|
||||||
|
icon: 'mdi:alert-circle-outline',
|
||||||
|
order: 99,
|
||||||
},
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'ERROR-401',
|
||||||
|
path: '401',
|
||||||
|
component: () => import('@/views/error-page/401.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '401',
|
||||||
|
icon: 'material-symbols:authenticator',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ERROR-403',
|
||||||
|
path: '403',
|
||||||
|
component: () => import('@/views/error-page/403.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '403',
|
||||||
|
icon: 'solar:forbidden-circle-line-duotone',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ERROR-404',
|
||||||
|
path: '404',
|
||||||
|
component: () => import('@/views/error-page/404.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '404',
|
||||||
|
icon: 'tabler:error-404',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ERROR-500',
|
||||||
|
path: '500',
|
||||||
|
component: () => import('@/views/error-page/500.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '500',
|
||||||
|
icon: 'clarity:rack-server-outline-alerted',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
16
web/src/views/error-page/401.vue
Normal file
16
web/src/views/error-page/401.vue
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<AppPage>
|
||||||
|
<n-result m-auto status="401">
|
||||||
|
<template #icon>
|
||||||
|
<icon-custom-unauthorized text-400px text-primary></icon-custom-unauthorized>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<n-button type="primary" @click="replace('/')">返回首页</n-button>
|
||||||
|
</template>
|
||||||
|
</n-result>
|
||||||
|
</AppPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const { replace } = useRouter()
|
||||||
|
</script>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppPage>
|
<AppPage>
|
||||||
<n-result m-auto status="403" description="抱歉,您无权访问该页面">
|
<n-result m-auto status="403">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-custom-forbidden text-400px text-primary></icon-custom-forbidden>
|
<icon-custom-forbidden text-400px text-primary></icon-custom-forbidden>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppPage>
|
<AppPage>
|
||||||
<n-result m-auto status="404" description="抱歉,您访问的页面不存在。">
|
<n-result m-auto status="404">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-custom-not-found text-400px text-primary></icon-custom-not-found>
|
<icon-custom-not-found text-400px text-primary></icon-custom-not-found>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
16
web/src/views/error-page/500.vue
Normal file
16
web/src/views/error-page/500.vue
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<AppPage>
|
||||||
|
<n-result m-auto status="500">
|
||||||
|
<template #icon>
|
||||||
|
<icon-custom-server-error text-400px text-primary></icon-custom-server-error>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<n-button type="primary" @click="replace('/')">返回首页</n-button>
|
||||||
|
</template>
|
||||||
|
</n-result>
|
||||||
|
</AppPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const { replace } = useRouter()
|
||||||
|
</script>
|
||||||
@ -1,24 +0,0 @@
|
|||||||
const Layout = () => import('@/layout/index.vue')
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ErrorPage',
|
|
||||||
path: '/error-page',
|
|
||||||
component: Layout,
|
|
||||||
redirect: '/error-page/404',
|
|
||||||
meta: {
|
|
||||||
title: '错误页',
|
|
||||||
icon: 'mdi:alert-circle-outline',
|
|
||||||
order: 99,
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'ERROR-404',
|
|
||||||
path: '404',
|
|
||||||
component: () => import('./404.vue'),
|
|
||||||
meta: {
|
|
||||||
title: '404',
|
|
||||||
icon: 'tabler:error-404',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user