mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 02:54:05 +08:00
fix: 修复后端返回路由数据中 children 为空数组导致菜单无法正常生成
This commit is contained in:
@@ -163,11 +163,12 @@ const useMenuStore = defineStore(
|
||||
menus.forEach((menu) => {
|
||||
if (hasPermission(permissions, menu)) {
|
||||
const tmpMenu = cloneDeep(menu)
|
||||
if (tmpMenu.children) {
|
||||
if (tmpMenu.children && tmpMenu.children.length > 0) {
|
||||
tmpMenu.children = filterAsyncMenus(tmpMenu.children, permissions) as Menu.recordRaw[]
|
||||
tmpMenu.children.length && res.push(tmpMenu)
|
||||
tmpMenu.children.length > 0 && res.push(tmpMenu)
|
||||
}
|
||||
else {
|
||||
delete tmpMenu.children
|
||||
res.push(tmpMenu)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user