forked from jekip/naive-ui-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
428 additions
and
34 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export enum PageEnum { | ||
// basic login path | ||
// 登录 | ||
BASE_LOGIN = '/login', | ||
// basic home path | ||
//重定向 | ||
REDIRECT = '/Redirect', | ||
// 首页 | ||
BASE_HOME = '/dashboard', | ||
// error page path | ||
// 错误 | ||
ERROR_PAGE = '/exception', | ||
// error log page path | ||
ERROR_LOG_PAGE = '/error-log/list', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
import { MainView } from '@/layout/components/Main' | ||
|
||
export const RedirectName = 'Redirect'; | ||
|
||
export const ParentLayout = 'ParentLayout'; | ||
|
||
export const ErrorPage = () => import('@/views/exception/404.vue'); | ||
|
||
/** | ||
* @description: default layout | ||
*/ | ||
export const Layout = () => import('@/layout/index.vue'); | ||
|
||
/** | ||
* @description: parent-layout | ||
*/ | ||
export const getParentLayout = (_name?: string) => { | ||
return () => | ||
new Promise((resolve) => { | ||
resolve({ | ||
name: PARENT_LAYOUT_NAME, | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { RouteRecordRaw } from 'vue-router' | ||
import { Layout } from '@/router/constant'; | ||
import { ExclamationCircleOutlined } from '@vicons/antd' | ||
import { renderIcon } from '@/utils/index' | ||
|
||
/** | ||
* @param name 路由名称, 必须设置,且不能重名 | ||
* @param meta 路由元信息(路由附带扩展信息) | ||
* @param redirect 重定向地址, 访问这个路由时,自定进行重定向 | ||
* @param meta.disabled 禁用整个菜单 | ||
* @param meta.title 菜单名称 | ||
* @param meta.icon 菜单图标 | ||
* @param meta.keepAlive 缓存该路由 | ||
* @param meta.sort 排序越小越排前 | ||
* | ||
* */ | ||
const routes: Array<RouteRecordRaw> = [ | ||
{ | ||
path: '/exception', | ||
name: 'Exception', | ||
redirect: '/exception/403', | ||
component: Layout, | ||
meta: { | ||
title: '异常页面', | ||
icon: renderIcon(ExclamationCircleOutlined), | ||
sort: 3 | ||
}, | ||
children: [ | ||
{ | ||
path: '403', | ||
name: 'exception-403', | ||
meta: { | ||
title: '403', | ||
}, | ||
component: () => import('@/views/exception/403.vue') | ||
}, | ||
{ | ||
path: '404', | ||
name: 'exception-404', | ||
meta: { | ||
title: '404', | ||
}, | ||
component: () => import('@/views/exception/404.vue') | ||
}, | ||
{ | ||
path: '500', | ||
name: 'exception-500', | ||
meta: { | ||
title: '500', | ||
}, | ||
component: () => import('@/views/exception/500.vue') | ||
}, | ||
], | ||
} | ||
] | ||
|
||
export default routes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { RouteRecordRaw } from 'vue-router' | ||
import { Layout } from '@/router/constant'; | ||
import { CheckCircleOutlined } from '@vicons/antd' | ||
import { renderIcon } from '@/utils/index' | ||
|
||
/** | ||
* @param name 路由名称, 必须设置,且不能重名 | ||
* @param meta 路由元信息(路由附带扩展信息) | ||
* @param redirect 重定向地址, 访问这个路由时,自定进行重定向 | ||
* @param meta.disabled 禁用整个菜单 | ||
* @param meta.title 菜单名称 | ||
* @param meta.icon 菜单图标 | ||
* @param meta.keepAlive 缓存该路由 | ||
* @param meta.sort 排序越小越排前 | ||
* | ||
* */ | ||
const routes: Array<RouteRecordRaw> = [ | ||
{ | ||
path: '/result', | ||
name: 'Result', | ||
redirect: '/result/success', | ||
component: Layout, | ||
meta: { | ||
title: '结果页面', | ||
icon: renderIcon(CheckCircleOutlined), | ||
sort: 4 | ||
}, | ||
children: [ | ||
{ | ||
path: 'success', | ||
name: 'result-success', | ||
meta: { | ||
title: '成功页', | ||
}, | ||
component: () => import('@/views/result/success.vue') | ||
}, | ||
{ | ||
path: 'fail', | ||
name: 'result-fail', | ||
meta: { | ||
title: '失败页', | ||
}, | ||
component: () => import('@/views/result/fail.vue') | ||
}, | ||
{ | ||
path: 'info', | ||
name: 'result-info', | ||
meta: { | ||
title: '信息页', | ||
}, | ||
component: () => import('@/views/result/info.vue') | ||
}, | ||
], | ||
} | ||
] | ||
|
||
export default routes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<div class="flex flex-col justify-center page-container"> | ||
<div class="text-center"> | ||
<img src="~@/assets/images/exception/403.svg" alt=""/> | ||
</div> | ||
<div class="text-center"> | ||
<h1 class="text-base text-gray-500">抱歉,你无权访问该页面</h1> | ||
<n-button type="info" @click="goHome">回到首页</n-button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useRouter } from 'vue-router' | ||
export default defineComponent({ | ||
setup() { | ||
const router = useRouter() | ||
return { | ||
goHome(){ | ||
router.push('/') | ||
} | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.page-container { | ||
width: 100%; | ||
background-color: white; | ||
border-radius: 4px; | ||
padding: 50px 0; | ||
.text-center{ | ||
h1{ color: #666;padding: 20px 0} | ||
} | ||
img { | ||
width: 350px; | ||
margin: 0 auto; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<div class="flex flex-col justify-center page-container"> | ||
<div class="text-center"> | ||
<img src="~@/assets/images/exception/500.svg" alt=""/> | ||
</div> | ||
<div class="text-center"> | ||
<h1 class="text-base text-gray-500">抱歉,服务器出错了</h1> | ||
<n-button type="info" @click="goHome">回到首页</n-button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useRouter } from 'vue-router' | ||
export default defineComponent({ | ||
setup() { | ||
const router = useRouter() | ||
return { | ||
goHome(){ | ||
router.push('/') | ||
} | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.page-container { | ||
width: 100%; | ||
background-color: white; | ||
border-radius: 4px; | ||
padding: 50px 0; | ||
.text-center{ | ||
h1{ color: #666;padding: 20px 0} | ||
} | ||
img { | ||
width: 350px; | ||
margin: 0 auto; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.