From 01e10388e45e9227c98b215c5b3b28dcac4aa05c Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 10 Mar 2025 19:19:35 +0800 Subject: [PATCH] disable tutorial management --- src/components/Corner.vue | 4 ++-- src/components/Tutorial.vue | 4 +++- src/pages/Dashboard.vue | 3 +++ src/utils/const.ts | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/Corner.vue b/src/components/Corner.vue index 029d297..9142047 100644 --- a/src/components/Corner.vue +++ b/src/components/Corner.vue @@ -23,7 +23,7 @@ import { useMessage } from "naive-ui" import { Icon } from "@iconify/vue" import { authed, roleNormal, roleSuper, user } from "../store/user" import { loginModal } from "../store/modal" -import { show, step, tutorialSize } from "../store/tutorial" +import { show, tutorialSize } from "../store/tutorial" import { Account } from "../api" import { Role } from "../utils/type" import { router } from "../router" @@ -68,7 +68,7 @@ function showTutorial() { function clickMenu(name: string) { switch (name) { case "dashboard": - router.push({ name: "tutorial", params: { display: step.value } }) + router.push({ name: "user-manage", params: { page: 1 } }) break case "admin": window.open(ADMIN_URL) diff --git a/src/components/Tutorial.vue b/src/components/Tutorial.vue index 56f7c80..11b605c 100644 --- a/src/components/Tutorial.vue +++ b/src/components/Tutorial.vue @@ -34,9 +34,11 @@ import { css, html, js, tab } from "../store/editors" import { Tutorial } from "../api" import { step } from "../store/tutorial" import { authed, roleSuper } from "../store/user" +import { useStorage } from "@vueuse/core" +import { STORAGE_KEY } from "../utils/const" const displays = ref([]) -const content = ref("") +const content = useStorage(STORAGE_KEY.CONTENT, "") const $content = useTemplateRef("$content") defineEmits(["hide"]) diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue index a1413d4..802185b 100644 --- a/src/pages/Dashboard.vue +++ b/src/pages/Dashboard.vue @@ -6,8 +6,10 @@ {{ item.label }} @@ -24,6 +26,7 @@ const menu = [ { label: "教程", route: { name: "tutorial", params: { display: step.value } }, + disabled: true }, { label: "用户", route: { name: "user-manage", params: { page: 1 } } }, ] diff --git a/src/utils/const.ts b/src/utils/const.ts index 475da3d..40e20a4 100644 --- a/src/utils/const.ts +++ b/src/utils/const.ts @@ -29,6 +29,7 @@ export const alertVariants = [ export const STORAGE_KEY = { LOGIN: "web-isloggedin", STEP: "web-turtorial-step", + CONTENT: "web-turtorial-content", HTML: "web-html", CSS: "web-css", JS: "web-js",