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',
2024-09-25 22:24:16 +08:00
meta: { title: 'Login' },
2024-09-13 16:34:15 +08:00
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-25 22:24:16 +08:00
meta: { title: 'My', icon: 'UserFilled' },
2024-09-13 16:34:15 +08:00
component: () => import('@/layout/index.vue'),
children: [
{
path: '/',
2024-09-19 10:46:07 +08:00
name: 'MyInfo',
2024-09-25 22:24:16 +08:00
meta: { title: 'Info', icon: 'User' /*keepAlive: true*/ },
2024-09-19 10:46:07 +08:00
component: () => import('@/views/my/info.vue'),
},
{
path: 'address_book',
2024-09-13 16:34:15 +08:00
name: 'MyAddressBookList',
2024-09-25 22:24:16 +08:00
meta: { title: 'AddressBooks', icon: 'Notebook' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
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',
2024-09-25 22:24:16 +08:00
meta: { title: 'Tags', icon: 'CollectionTag' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/my/tag/index.vue'),
},
],
},
{
path: '/user',
name: 'User',
redirect: '/user/index',
2024-09-25 22:24:16 +08:00
meta: { title: 'System', icon: 'Setting' },
2024-09-13 16:34:15 +08:00
component: () => import('@/layout/index.vue'),
children: [
{
path: 'peer',
name: 'Peer',
2024-09-25 22:24:16 +08:00
meta: { title: 'PeerManage', icon: 'Monitor' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/peer/index.vue'),
},
{
path: 'group',
name: 'UserGroup',
2024-09-25 22:24:16 +08:00
meta: { title: 'GroupManage', icon: 'ChatRound' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/group/index.vue'),
},
{
path: 'index',
name: 'UserList',
2024-09-25 22:24:16 +08:00
meta: { title: 'UserManage', icon: 'User' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/user/index.vue'),
},
{
path: 'add',
name: 'UserAdd',
2024-09-25 22:24:16 +08:00
meta: { title: 'UserAdd', hide: true },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/user/edit.vue'),
},
{
path: 'edit/:id',
name: 'UserEdit',
2024-09-25 22:24:16 +08:00
meta: { title: 'UserEdit', hide: true },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/user/edit.vue'),
},
{
path: 'addressBook',
name: 'UserAddressBook',
2024-09-25 22:24:16 +08:00
meta: { title: 'AddressBookManage', icon: 'Notebook' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/address_book/index.vue'),
},
{
path: 'tag',
name: 'UserTag',
2024-09-25 22:24:16 +08:00
meta: { title: 'TagsManage', icon: 'CollectionTag' /*keepAlive: true*/ },
2024-09-13 16:34:15 +08:00
component: () => import('@/views/tag/index.vue'),
},
2024-09-19 10:46:07 +08:00
{
path: '/oauth',
name: 'Oauth',
2024-09-25 22:24:16 +08:00
meta: { title: 'OauthManage', icon: 'Link' /*keepAlive: true*/ },
2024-09-19 10:46:07 +08:00
component: () => import('@/views/oauth/index.vue'),
},
{
path: '/loginLog',
name: 'LoginLog',
2024-09-25 22:24:16 +08:00
meta: { title: 'LoginLog', icon: 'List' /*keepAlive: true*/ },
2024-09-19 10:46:07 +08:00
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,
})