mirror of
				https://github.com/soybeanjs/soybean-admin.git
				synced 2025-11-04 15:53:43 +08:00 
			
		
		
		
	feat(projects): add constant route page without login status[添加未登录可访问的固定路由示例页面]
This commit is contained in:
		@@ -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>
 | 
			
		||||
		Reference in New Issue
	
	Block a user