feat(auth): 重构权限管理系统和路由结构
All checks were successful
构建Docker镜像 / build-and-deploy (push) Successful in 1m33s

This commit is contained in:
2025-09-04 13:08:48 +08:00
parent 509b274c5c
commit 640b1aa99e
7 changed files with 184 additions and 81 deletions

View File

@@ -1,64 +1,15 @@
<script setup lang="ts">
import {ref, watch} from 'vue'
import {useRoute, useRouter} from "vue-router";
import {useCounterStore} from "@/stores/counter.ts";
const router = useRouter()
const route = useRoute()
const activeIndex = ref(route.name?.toString() || "TokenList")
watch(route, (newRoute) => {
activeIndex.value = newRoute.name?.toString() || "TokenList"
})
const handleSelect = (key: string) => {
router.push({
name: key
})
}
</script>
<template>
<el-container>
<el-header>
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="TokenDetail">Token详细信息</el-menu-item>
<el-menu-item index="TokenManage">管理Token</el-menu-item>
<el-menu-item v-if="useCounterStore().isAdmin">
<el-button type="danger" plain @click="useCounterStore().isAdmin=false">退出管理员</el-button>
</el-menu-item>
</el-menu>
</el-header>
<el-container>
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-container>
<router-view></router-view>
</template>
<style>
<style scoped>
html, body, #app {
height: 100%;
margin: 0;
padding: 0;
}
.el-container {
height: 100%;
}
.el-menu-demo {
line-height: 60px;
}
</style>