This commit is contained in:
2025-03-04 23:59:49 +08:00
parent 175e4c0d68
commit e6b7fe3848
6 changed files with 48 additions and 12 deletions

View File

@@ -20,11 +20,12 @@
import { computed, h } from "vue"
import { useMessage } from "naive-ui"
import { Icon } from "@iconify/vue"
import { user, authed, roleNormal } from "../store/user"
import { user, authed, roleNormal, roleSuper } from "../store/user"
import { loginModal } from "../store/modal"
import { Account } from "../api"
import { Role } from "../utils/type"
import { router } from "../router"
import { ADMIN_URL } from "../utils/const"
const message = useMessage()
@@ -38,6 +39,15 @@ const menu = computed(() => [
icon: "streamline-emojis:robot-face-1",
}),
},
{
label: "管理",
key: "admin",
show: roleSuper.value,
icon: () =>
h(Icon, {
icon: "skill-icons:django",
}),
},
{
label: "退出",
key: "logout",
@@ -53,6 +63,9 @@ function clickMenu(name: string) {
case "dashboard":
router.push({ name: "tutorial" })
break
case "admin":
window.open(ADMIN_URL)
break
case "logout":
handleLogout()
break