This commit is contained in:
2023-01-13 22:11:28 +08:00
parent 46fcccda35
commit d45783334d
41 changed files with 544 additions and 256 deletions

View File

@@ -1,55 +1,54 @@
import Home from "./oj/index.vue"
import Problems from "./oj/problem/list.vue"
const routes = [
export const routes = [
{
path: "/",
component: Home,
component: () => import("~/shared/layout/default.vue"),
children: [
{ path: "", component: Problems },
{ path: "/learn/:step*", component: () => import("./learn/index.vue") },
{ path: "", component: () => import("oj/problem/list.vue") },
{
path: "problem/:problemID",
component: () => import("./oj/problem/detail.vue"),
component: () => import("oj/problem/detail.vue"),
props: true,
name: "ProblemDetail",
},
{
path: "status",
component: () => import("./oj/status/list.vue"),
meta: { requiresAuth: true },
component: () => import("oj/status/list.vue"),
},
{
path: "status/:statusID",
component: () => import("./oj/status/detail.vue"),
component: () => import("oj/status/detail.vue"),
props: true,
},
{
path: "contest",
component: () => import("./oj/contest/list.vue"),
component: () => import("oj/contest/list.vue"),
meta: { requiresAuth: true },
},
{
path: "contest/:contestID",
component: () => import("./oj/contest/detail.vue"),
component: () => import("oj/contest/detail.vue"),
props: true,
},
{
path: "contest/:contestID/problem/:problemID",
component: () => import("./oj/problem/detail.vue"),
component: () => import("oj/problem/detail.vue"),
props: true,
name: "ContestProblemDetail",
},
{
path: "rank",
component: () => import("./oj/rank/list.vue"),
},
{
path: "/admin",
component: () => import("./admin/index.vue"),
component: () => import("oj/rank/list.vue"),
},
],
},
{
path: "/learn",
component: () => import("~/shared/layout/default.vue"),
children: [{ path: ":step*", component: () => import("learn/index.vue") }],
},
{
path: "/admin",
component: () => import("~/shared/layout/admin.vue"),
children: [{ path: "", component: () => import("admin/index.vue") }],
},
]
export default routes