feat: 接入权限接口
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user