feat(projects): add constant route page without login status[添加未登录可访问的固定路由示例页面]

This commit is contained in:
Soybean 2022-09-21 18:45:28 +08:00
parent 82c4b09b94
commit 78efd7793a
3 changed files with 26 additions and 0 deletions

View File

@ -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',

View File

@ -11,6 +11,7 @@ declare namespace AuthRoute {
| 'not-found'
| 'no-permission'
| 'service-error'
| 'constant-page'
| 'not-found-page' // 捕获无效path的路由
// 自定义路由
| 'dashboard'

View 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>