feat: 接入权限接口

This commit is contained in:
xy
2026-09-24 08:31:21 +08:00
parent 93fb5fd2c4
commit e5b5412322
24 changed files with 2398 additions and 1738 deletions
+10 -2
View File
@@ -3,12 +3,20 @@ import { computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { useAppStore } from '@/stores/app'
import { useLoginStore } from '@/stores/login'
const route = useRoute()
const appStore = useAppStore()
const loginStore = useLoginStore()
const pageTitle = computed(() => String(route.meta.title ?? '首页'))
const pageGroup = computed(() => String(route.meta.group ?? '工作台'))
const currentResource = computed(() => loginStore.menuForPath(route.path))
const pageTitle = computed(() => currentResource.value?.name ?? String(route.meta.title ?? '首页'))
const pageGroup = computed(() => {
const directory = loginStore.authorization?.navigation.find((item) =>
item.children?.some((child) => child.id === currentResource.value?.id),
)
return directory?.name ?? String(route.meta.group ?? '工作台')
})
const selectedCampusId = computed<string>({
get: () => appStore.selectedCampusId,
set: (id) => appStore.selectCampus(id),