Skip to content

Commit

Permalink
feat(projects): add constant route page without login status[添加未登录可访问…
Browse files Browse the repository at this point in the history
…的固定路由示例页面]
  • Loading branch information
honghuangdc committed Sep 21, 2022
1 parent 82c4b09 commit 78efd77
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/router/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/typings/route.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare namespace AuthRoute {
| 'not-found'
| 'no-permission'
| 'service-error'
| 'constant-page'
| 'not-found-page' // 捕获无效path的路由
// 自定义路由
| 'dashboard'
Expand Down
16 changes: 16 additions & 0 deletions src/views/system-view/constant-page/index.vue
Original file line number Diff line number Diff line change
@@ -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>

1 comment on commit 78efd77

@vercel
Copy link

@vercel vercel bot commented on 78efd77 Sep 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.