feat(projects): add constant route page without login status[添加未登录可访问的固定路由示例页面]
This commit is contained in:
parent
82c4b09b94
commit
78efd7793a
@ -29,6 +29,15 @@ export const constantRoutes: AuthRoute.Route[] = [
|
||||
singleLayout: 'blank'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'constant-page',
|
||||
path: '/constant-page',
|
||||
component: 'self',
|
||||
meta: {
|
||||
title: '固定页面',
|
||||
singleLayout: 'blank'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'no-permission',
|
||||
path: '/no-permission',
|
||||
|
1
src/typings/route.d.ts
vendored
1
src/typings/route.d.ts
vendored
@ -11,6 +11,7 @@ declare namespace AuthRoute {
|
||||
| 'not-found'
|
||||
| 'no-permission'
|
||||
| 'service-error'
|
||||
| 'constant-page'
|
||||
| 'not-found-page' // 捕获无效path的路由
|
||||
// 自定义路由
|
||||
| 'dashboard'
|
||||
|
16
src/views/system-view/constant-page/index.vue
Normal file
16
src/views/system-view/constant-page/index.vue
Normal file
@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<div class="wh-full flex-col-center">
|
||||
<n-gradient-text class="mb-24px" type="primary" :size="28">Custom Constant Page</n-gradient-text>
|
||||
<router-link :to="{ name: routeHomePath }">
|
||||
<n-button type="primary">回到首页</n-button>
|
||||
</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { routeName } from '@/router';
|
||||
|
||||
const routeHomePath = routeName('root');
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
Loading…
Reference in New Issue
Block a user