wu
2024-12-23 b9b44b51b201e2f5a9a1f3665c7fb76b5690f9af
UI-Project/src/router/index.js
@@ -27,8 +27,6 @@
      name: 'main',
      component: () => import('../layout/MainErpView.vue'),
      children:[
        {
          path: 'Temperedlayout',
          name: 'Temperedlayout',
@@ -41,34 +39,6 @@
            }
         ]
        },
/*----------- 用户列表 ----------------*/
// {
//   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',
@@ -76,27 +46,32 @@
        component: () => import('../views/Returns/return.vue'),
        children:[
          {
            path: '/Returns/returns',
            name: 'returns',
            component: () => import('../views/Returns/returns.vue')
          },
          {
            path: '/Returns/upreturns',
            name: 'upreturns',
            component: () => import('../views/Returns/upreturns.vue')
          },
          {
            path: '/Returns/upreturns2',
            name: 'upreturns2',
            component: () => import('../views/Returns/upreturns2.vue')
          },
        ]
      },
      /*----------- 掰片/识别 ----------------*/
    {
      path: 'Identify',
      name: 'Identify',
      component: () => import('../views/Identify/identify.vue'),
      children:[
      name: 'ident',
      component: () => import('../views/Identify/ident.vue'),
      children: [
        {
          path: '/Identify/identify',
          name: 'identify',
          component: () => import('../views/Identify/identify.vue')
        },
        {
          path: '/Identify/identifwu',
          name: 'identifwu',
          component: () => import('../views/Identify/identifwu.vue')
        },
      ]
    },
@@ -133,6 +108,11 @@
      path: '/StockBasicData/stockBasicDatatwo',
      name: 'stockBasicDatatwo',
      component: () => import('../views/StockBasicData/stockBasicDatatwo.vue')
    },
    {
      path: '/StockBasicData/stockBasicyiwu',
      name: 'stockBasicyiwu',
      component: () => import('../views/StockBasicData/stockBasicyiwu.vue')
    },
  ]
},
@@ -213,7 +193,7 @@
            }
          ]
        },
         /*----------- 可视化系统 ----------------*/
         {
          path: 'Visualization',
@@ -278,7 +258,7 @@
    path: 'reportWork',
    name: 'reportWork',
    component: () => import('../views/ReportWork/reportWork.vue'),
    children:[
    children: [
      {
        path: '/ReportWork/reportWork',
        name: 'reportWork',
@@ -286,6 +266,20 @@
      },
    ]
  },
        /*----------- 中空 ----------------*/
        {
          path: 'hollow',
          name: 'hollowequipment',
          component: () => import('../views/hollow/hollowequipment.vue'),
          children: [
            {
              path: '/hollow/hollowequipment',
              name: 'hollowequipment',
              component: () => import('../views/hollow/hollowequipment.vue')
            },
          ]
        },
        /*----------- 管理系统 ----------------*/
        {
          path: 'sys',
@@ -320,10 +314,8 @@
      name: 'register',
      component: () => import('../views/RegisterView.vue')
    }
  ]
})
// 导航守卫  
router.beforeEach((to, from, next) => {  
  const isAuthenticated = !!localStorage.getItem('authToken'); // 假设这是你的登录状态检查逻辑  
@@ -333,4 +325,4 @@
    next(); // 否则继续导航  
  }  
}); 
export default router
export default router