From 7615cd178bddab96443504029285d65ea1e7d447 Mon Sep 17 00:00:00 2001 From: pyt <626651354@qq.com> Date: 星期五, 16 五月 2025 09:22:21 +0800 Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory --- culture/src/router/index.js | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/culture/src/router/index.js b/culture/src/router/index.js index f8113b5..2d85a1d 100644 --- a/culture/src/router/index.js +++ b/culture/src/router/index.js @@ -61,6 +61,24 @@ keepAlive: true, }, component: () => import("../views/projectList/addProject"), + }, + { + path: "editProject", + name: "EditProject", + meta: { + title: "编辑菌种库项目组", + hide: true, + }, + component: () => import("../views/projectList/editProject"), + }, + { + path: "detailProject", + name: "DetailProject", + meta: { + title: "菌种库项目组详情", + hide: true, + }, + component: () => import("../views/projectList/detailProject"), } ] }, @@ -244,7 +262,7 @@ { path: 'breeding-record', name: 'BreedingRecord', - meta: { + meta: { title: "菌种选育保藏记录", }, component: () => import("../views/strain-library/breeding-record"), @@ -417,21 +435,21 @@ // 登录验证 // 排除登录页的校验 - // if (to.path === "/login") { - // if (sessionStorage.getItem('token')) { - // next('/projectList'); // 已登录状态访问登录页时重定向到系统首页 - // return; - // } - // next(); - // return; - // } + if (to.path === "/login") { + if (sessionStorage.getItem('token')) { + next('/projectList'); // 已登录状态访问登录页时重定向到系统首页 + return; + } + next(); + return; + } - // // 登录状态校验 - // const isAuthenticated = sessionStorage.getItem('token'); - // if (!isAuthenticated) { - // next('/login'); // 未登录用户重定向到登录页 - // return; - // } + // 登录状态校验 + const isAuthenticated = sessionStorage.getItem('token'); + if (!isAuthenticated) { + next('/login'); // 未登录用户重定向到登录页 + return; + } // 判断是否拥有要跳转菜单权限 let menus = store.state.menus -- Gitblit v1.7.1