From ff81567007f64f4c4a2c5dcc2c76706f81fe996d Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 5 Jan 2026 14:43:03 +0800 Subject: [PATCH] fix --- src/oj/store/problem.ts | 3 ++- src/routes.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/oj/store/problem.ts b/src/oj/store/problem.ts index f33cc78..317a5bf 100644 --- a/src/oj/store/problem.ts +++ b/src/oj/store/problem.ts @@ -8,10 +8,11 @@ import { LANGUAGE, Problem } from "utils/types" export const useProblemStore = defineStore("problem", () => { // ==================== 状态 ==================== const problem = ref(null) + const route = useRoute() // ==================== 计算属性 ==================== const languages = computed(() => { - if (problem.value?.allow_flowchart) { + if (route.name === "problem" && problem.value?.allow_flowchart) { return ["Flowchart", ...problem.value?.languages] } return problem.value?.languages ?? [] diff --git a/src/routes.ts b/src/routes.ts index 6cc0950..db6ef47 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -64,14 +64,17 @@ export const ojs: RouteRecordRaw = { }, { path: "rank", + name: "rank", component: () => import("oj/rank/list.vue"), }, { path: "class", + name: "class", component: () => import("oj/class/pk.vue"), }, { path: "announcement", + name: "announcements", component: () => import("oj/announcement/list.vue"), }, { @@ -97,11 +100,13 @@ export const ojs: RouteRecordRaw = { }, { path: "ai-analysis", + name: "ai", component: () => import("oj/ai/analysis.vue"), meta: { requiresAuth: true }, }, { path: "flowchart", + name: "flowchart", component: () => import("oj/flowchart/index.vue"), }, {