前端代码第一次提交
This commit is contained in:
45
rc_autoplc_front/src/router/index.ts
Normal file
45
rc_autoplc_front/src/router/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'user',
|
||||
component: () => import('../views/user/index.vue'),
|
||||
},
|
||||
{
|
||||
path: '/role',
|
||||
name: 'role',
|
||||
component: () => import('../views/role/index.vue'),
|
||||
},
|
||||
{
|
||||
path: '/department',
|
||||
name: 'department',
|
||||
component: () => import('../views/department/index.vue'),
|
||||
},
|
||||
{
|
||||
path: '/position',
|
||||
name: 'position',
|
||||
component: () => import('../views/position/index.vue'),
|
||||
},
|
||||
{
|
||||
path: '/manage-log',
|
||||
name: 'manage-log',
|
||||
component: () => import('../views/manage-log/index.vue'),
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
// 添加全局路由守卫
|
||||
// router.beforeEach((to, from, next) => {
|
||||
// const token = localStorage.getItem('token')
|
||||
|
||||
// if (to.path !== '/login' && !token) {
|
||||
// next('/login')
|
||||
// } else {
|
||||
// next()
|
||||
// }
|
||||
// })
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user