Files
rustdesk-api-web/src/router/index.js
T

145 lines
3.9 KiB
JavaScript
Raw Normal View History

2024-09-13 16:34:15 +08:00
import { createRouter, createWebHashHistory } from 'vue-router'
const constantRoutes = [
{
path: '/login',
name: 'Login',
meta: { title: '登录' },
component: () => import('@/views/login/login.vue'),
},
{
path: '/404',
component: () => import('@/views/error-page/404.vue'),
hidden: true,
},
2024-09-19 10:46:07 +08:00
{
path: '/oauth/:code',
component: () => import('@/views/oauth/login.vue'),
hidden: true,
},
{
path: '/oauth/bind/:code',
component: () => import('@/views/oauth/bind.vue'),
hidden: true,
},
2024-09-13 16:34:15 +08:00
]
export const asyncRoutes = [
// {
// path: '/',
// name: 'Index',
// redirect: '/Home',
// meta: { title: '首页', icon: 'house' },
// component: () => import('@/layout/index.vue'),
// children: [
// {
// path: '/Home',
// name: 'Home',
// meta: { title: '首页', icon: 'house' },
// component: () => import('@/views/index/index.vue'),
// },
//
// ],
// },
{
path: '/my',
name: 'My',
2024-09-19 10:46:07 +08:00
redirect: '/my/info',
2024-09-13 16:34:15 +08:00
meta: { title: '我的', icon: 'UserFilled' },
component: () => import('@/layout/index.vue'),
children: [
{
path: '/',
2024-09-19 10:46:07 +08:00
name: 'MyInfo',
meta: { title: '个人信息', icon: 'User' /*keepAlive: true*/ },
component: () => import('@/views/my/info.vue'),
},
{
path: 'address_book',
2024-09-13 16:34:15 +08:00
name: 'MyAddressBookList',
meta: { title: '地址簿管理', icon: 'Notebook' /*keepAlive: true*/ },
component: () => import('@/views/my/address_book/index.vue'),
},
{
2024-09-19 10:46:07 +08:00
path: 'tag',
2024-09-13 16:34:15 +08:00
name: 'MyTagList',
meta: { title: '标签管理', icon: 'CollectionTag' /*keepAlive: true*/ },
component: () => import('@/views/my/tag/index.vue'),
},
],
},
{
path: '/user',
name: 'User',
redirect: '/user/index',
meta: { title: '系统', icon: 'Setting' },
component: () => import('@/layout/index.vue'),
children: [
{
path: 'peer',
name: 'Peer',
meta: { title: '设备管理', icon: 'Monitor' /*keepAlive: true*/ },
component: () => import('@/views/peer/index.vue'),
},
{
path: 'group',
name: 'UserGroup',
meta: { title: '群组管理', icon: 'ChatRound' /*keepAlive: true*/ },
component: () => import('@/views/group/index.vue'),
},
{
path: 'index',
name: 'UserList',
meta: { title: '用户列表', icon: 'User' /*keepAlive: true*/ },
component: () => import('@/views/user/index.vue'),
},
{
path: 'add',
name: 'UserAdd',
meta: { title: '用户添加', hide: true },
component: () => import('@/views/user/edit.vue'),
},
{
path: 'edit/:id',
name: 'UserEdit',
meta: { title: '用户编辑', hide: true },
component: () => import('@/views/user/edit.vue'),
},
{
path: 'addressBook',
name: 'UserAddressBook',
meta: { title: '地址簿管理', icon: 'Notebook' /*keepAlive: true*/ },
component: () => import('@/views/address_book/index.vue'),
},
{
path: 'tag',
name: 'UserTag',
meta: { title: '标签管理', icon: 'CollectionTag' /*keepAlive: true*/ },
component: () => import('@/views/tag/index.vue'),
},
2024-09-19 10:46:07 +08:00
{
path: '/oauth',
name: 'Oauth',
meta: { title: 'Oauth管理', icon: 'Link' /*keepAlive: true*/ },
component: () => import('@/views/oauth/index.vue'),
},
{
path: '/loginLog',
name: 'LoginLog',
meta: { title: '登录日志', icon: 'List' /*keepAlive: true*/ },
component: () => import('@/views/login/log.vue'),
},
2024-09-13 16:34:15 +08:00
],
},
]
export const lastRoutes = [
{ path: '/:catchAll(.*)', redirect: '/404', meta: { hide: true } },
]
export const router = createRouter({
history: createWebHashHistory(),
routes: constantRoutes,
})