diff --git a/src/models/menu.js b/src/models/menu.js index 55e7909c5b451bc3487f09c1252bd744954ddabf..2e803f06ba246c0812e67631621c082ddade1747 100644 --- a/src/models/menu.js +++ b/src/models/menu.js @@ -8,6 +8,9 @@ const { check } = Authorized; // Conversion router to menu. function formatter(data, parentAuthority, parentName) { + if (!data) { + return undefined; + } return data .map(item => { if (!item.name || !item.path) { @@ -75,6 +78,9 @@ const filterMenuData = menuData => { * @param {Object} menuData 菜单配置 */ const getBreadcrumbNameMap = menuData => { + if (!menuData) { + return {}; + } const routerMap = {}; const flattenMenuData = data => {