wangfei
2025-01-07 e875c70fea51ffafd689fd0d5f8b51bd3df40de0
UI-Project/src/router/index.js
@@ -27,8 +27,6 @@
      name: 'main',
      component: () => import('../layout/MainErpView.vue'),
      children:[
        {
          path: 'Temperedlayout',
          name: 'Temperedlayout',
@@ -41,45 +39,12 @@
            }
         ]
        },
/*----------- 用户列表 ----------------*/
// {
//   path: 'User',
//   name: 'User',
//   component: () => import('../views/User/userlist.vue'),
//   children:[
//     {
//       path: '/User/userlist',
//       name: 'userlist',
//       component: () => import('../views/User/userlist.vue')
//     },
//   ]
//   },
/*----------- 权限列表 ----------------*/
// {
//   path: 'Permissions',
//   name: 'Permissions',
//   component: () => import('../views/Permissions/permissionslist.vue'),
//   children:[
//     {
//       path: '/Permissions/permissionslist',
//       name: 'permissionslist',
//       component: () => import('../views/Permissions/permissionslist.vue')
//     },
//   ]
//   },
        /*----------- 上片机 ----------------*/
      {
        path: 'Returns',
        name: 'return',
        component: () => import('../views/Returns/return.vue'),
        children:[
          {
            path: '/Returns/returns',
            name: 'returns',
            component: () => import('../views/Returns/returns.vue')
          },
          {
            path: '/Returns/upreturns',
            name: 'upreturns',
@@ -108,6 +73,11 @@
          name: 'identifwu',
          component: () => import('../views/Identify/identifwu.vue')
        },
        {
          path: '/Identify/identifwutwo',
          name: 'identifwutwo',
          component: () => import('../views/Identify/identifwutwo.vue')
        },
      ]
    },
    /*----------- 卧式缓存 ----------------*/
@@ -125,11 +95,6 @@
        path: '/Caching/cachingun',
        name: 'cachingun',
        component: () => import('../views/Caching/cachingun.vue')
      },
      {
        path: '/Caching/cachingyiwu',
        name: 'cachingyiwu',
        component: () => import('../views/Caching/cachingyiwu.vue')
      },
    ]
  },
@@ -310,13 +275,23 @@
        /*----------- 中空 ----------------*/
        {
          path: 'hollow',
          name: 'hollowequipment',
          component: () => import('../views/hollow/hollowequipment.vue'),
          name: 'hol',
          component: () => import('../views/hollow/hol.vue'),
          children: [
            {
              path: '/hollow/hollowequipment',
              name: 'hollowequipment',
              component: () => import('../views/hollow/hollowequipment.vue')
            },
            {
              path: '/hollow/hollowequipmenttwo',
              name: 'hollowequipmenttwo',
              component: () => import('../views/hollow/hollowequipmenttwo.vue')
            },
            {
              path: '/hollow/hollowslicecage',
              name: 'hollowslicecage',
              component: () => import('../views/hollow/hollowslicecage.vue')
            },
          ]
        },
@@ -343,10 +318,10 @@
            // },
          ]
        },
        {
          path: '',
          redirect: '/Returns/returns'
        }
        // {
        //   path: '',
        //   redirect: '/hollow/hollowslicecage'
        // }
      ]
    },
    {
@@ -354,10 +329,8 @@
      name: 'register',
      component: () => import('../views/RegisterView.vue')
    }
  ]
})
// 导航守卫  
router.beforeEach((to, from, next) => {  
  const isAuthenticated = !!localStorage.getItem('authToken'); // 假设这是你的登录状态检查逻辑