Merge pull request 'role' (#109) from role into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/109
This commit is contained in:
@@ -10,7 +10,17 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
|||||||
const asyncRouters = ref([])
|
const asyncRouters = ref([])
|
||||||
//定义是否加载路由变量
|
//定义是否加载路由变量
|
||||||
const isLoadRoutes = ref(false)
|
const isLoadRoutes = ref(false)
|
||||||
const menuList = ref([])
|
const menuList = ref([
|
||||||
|
{
|
||||||
|
name: 'home',
|
||||||
|
path: '/home',
|
||||||
|
icon: 'home',
|
||||||
|
title: '首页',
|
||||||
|
meta: {
|
||||||
|
breadcrumb: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
const setIsLoadRoutes = (status) => {
|
const setIsLoadRoutes = (status) => {
|
||||||
return isLoadRoutes.value = status
|
return isLoadRoutes.value = status
|
||||||
@@ -21,7 +31,7 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
|||||||
const sRouter = JSON.parse(JSON.stringify(res.data))
|
const sRouter = JSON.parse(JSON.stringify(res.data))
|
||||||
const mData = JSON.parse(JSON.stringify(res.data))
|
const mData = JSON.parse(JSON.stringify(res.data))
|
||||||
asyncRouters.value = formatAsyncRouters(sRouter)
|
asyncRouters.value = formatAsyncRouters(sRouter)
|
||||||
menuList.value = generateMenu(mData)
|
menuList.value = [...menuList.value, ...generateMenu(mData)]
|
||||||
addAsyncRouters(asyncRouters.value)
|
addAsyncRouters(asyncRouters.value)
|
||||||
isLoadRoutes.value = false
|
isLoadRoutes.value = false
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user