删除项目列表模块(重复内容)
This commit is contained in:
@@ -4,7 +4,6 @@ import { useStudyStore } from "../store/study";
|
||||
import Layout from "../components/Layout.vue";
|
||||
import Login from "../views/Login.vue";
|
||||
import Register from "../views/Register.vue";
|
||||
import StudyList from "../views/StudyList.vue";
|
||||
import StudyHome from "../views/StudyHome.vue";
|
||||
import Milestones from "../views/Milestones.vue";
|
||||
import MilestoneDetail from "../views/MilestoneDetail.vue";
|
||||
@@ -52,7 +51,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/",
|
||||
component: Layout,
|
||||
redirect: "/studies",
|
||||
redirect: "/workbench",
|
||||
children: [
|
||||
{
|
||||
path: "workbench",
|
||||
@@ -243,18 +242,6 @@ const routes: RouteRecordRaw[] = [
|
||||
component: ProjectDetail,
|
||||
meta: { title: "项目详情", requiresAdmin: true },
|
||||
},
|
||||
{
|
||||
path: "/studies",
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
name: "StudyList",
|
||||
component: StudyList,
|
||||
meta: { title: "项目列表" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
@@ -280,12 +267,12 @@ router.beforeEach(async (to, _from, next) => {
|
||||
}
|
||||
if ((to.path === "/login" || to.path === "/register") && token) {
|
||||
if (!auth.forceLogin) {
|
||||
next({ path: studyStore.currentStudy ? "/study/home" : "/studies" });
|
||||
next({ path: studyStore.currentStudy ? "/study/home" : "/workbench" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (to.meta.requiresAdmin && auth.user?.role !== "ADMIN") {
|
||||
next({ path: "/studies" });
|
||||
next({ path: "/workbench" });
|
||||
return;
|
||||
}
|
||||
if (to.name === "AuditLogs") {
|
||||
@@ -297,7 +284,7 @@ router.beforeEach(async (to, _from, next) => {
|
||||
}
|
||||
}
|
||||
if (to.path.startsWith("/study") && !studyStore.currentStudy) {
|
||||
next({ path: "/studies" });
|
||||
next({ path: "/workbench" });
|
||||
return;
|
||||
}
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user