diff --git a/src/main.ts b/src/main.ts index 56d28a6..f6f5d72 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,13 +6,13 @@ import { STORAGE_KEY } from "utils/constants" import storage from "utils/storage" import App from "./App.vue" -import { admins, contestProblem, learns, ojs, problem } from "./routes" +import { admins, learns, ojs } from "./routes" import { toggleLogin } from "./shared/composables/modal" const router = createRouter({ history: createWebHistory(), - routes: [ojs, admins, problem, contestProblem, learns], + routes: [ojs, admins, learns], }) router.beforeEach((to, from, next) => { diff --git a/src/routes.ts b/src/routes.ts index 1c8a369..647cd77 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -1,40 +1,18 @@ import { RouteRecordRaw } from "vue-router" import { loadChart } from "./shared/composables/chart" -export const problem: RouteRecordRaw = { - path: "/problem/:problemID", - component: () => import("~/shared/layout/full.vue"), - children: [ - { - path: "", - component: () => import("oj/problem/detail.vue"), - props: true, - name: "problem", - beforeEnter: loadChart, - }, - ], -} - -export const contestProblem: RouteRecordRaw = { - path: "/contest/:contestID/problem/:problemID", - component: () => import("~/shared/layout/full.vue"), - children: [ - { - path: "", - component: () => import("oj/problem/detail.vue"), - props: true, - name: "contest problem", - meta: { requiresAuth: true }, - beforeEnter: loadChart, - }, - ], -} - export const ojs: RouteRecordRaw = { path: "/", component: () => import("~/shared/layout/default.vue"), children: [ { path: "", component: () => import("oj/problem/list.vue") }, + { + path: "problem/:problemID", + component: () => import("oj/problem/detail.vue"), + props: true, + name: "problem", + beforeEnter: loadChart, + }, { path: "submission", component: () => import("oj/submission/list.vue"), @@ -64,6 +42,14 @@ export const ojs: RouteRecordRaw = { meta: { requiresAuth: true }, name: "contest problems", }, + { + path: "problem/:problemID", + component: () => import("oj/problem/detail.vue"), + props: true, + name: "contest problem", + meta: { requiresAuth: true }, + beforeEnter: loadChart, + }, { path: "submission", component: () => import("oj/submission/list.vue"), @@ -108,7 +94,7 @@ export const ojs: RouteRecordRaw = { export const learns: RouteRecordRaw = { path: "/learn/:step+", - component: () => import("~/shared/layout/full.vue"), + component: () => import("~/shared/layout/default.vue"), children: [ { path: "", diff --git a/src/shared/layout/default.vue b/src/shared/layout/default.vue index b0f6d3c..9dfcc90 100644 --- a/src/shared/layout/default.vue +++ b/src/shared/layout/default.vue @@ -11,7 +11,7 @@ import Signup from "../components/Signup.vue"
@@ -23,7 +23,7 @@ import Signup from "../components/Signup.vue"