zhongrj
2025-03-28 4ff3eee77b41466d08117970970d01be6e48ffe1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { createRouter, RouteRecordRaw, createWebHistory, createWebHashHistory } from 'vue-router'
import { ERouterName } from '@/types/index'
 
// const router = createRouter({
//   history: createWebHistory(import.meta.env.BASE_URL),
//   routes: [
//     {
//       path: '/',
//       name: 'login',
//       component: () => import('../views/Login.vue'),
//     },
//     {
//       path: '/about',
//       name: 'about',
//       // route level code-splitting
//       // this generates a separate chunk (About.[hash].js) for this route
//       // which is lazy-loaded when the route is visited.
//       component: () => import('../views/AboutView.vue'),
//     },
//   ],
// })
const routes: Array<RouteRecordRaw> = [
  // {
  //   path: '/',
  //   redirect: '/' + ERouterName.LOGIN
  // },
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: ERouterName.LOGIN,
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/dronePilotList',
    name: ERouterName.DRONEPILOTLIST,
    component: () => import('@/views/DronePilotList.vue')
  },
  {
    path: '/dronePilotDetails',
    name: ERouterName.DRONEPILOTDETAILS,
    component: () => import('@/views/DronePilotDetails.vue')
  },
  {
    path: '/dronePilotShare',
    name: ERouterName.DRONEPILOTSHARE,
    component: () => import('@/views/DronePilotShare.vue')
  },
  {
    path: '/' + ERouterName.DRONE,
    name: ERouterName.DRONE,
    component: () => import('@/views/drone/index.vue')
  },
  {
    path: '/' + ERouterName.PILOT,
    name: ERouterName.PILOT,
    component: () => import('@/views/pilot/index.vue')
  },
]
 
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
})
 
export default router