Commit 32918e44 authored by 拷钉's avatar 拷钉 Committed by 陈帅

修复:有多个layout时,如果其中一个layout中没有routes,将发收到另一个layout的菜单 (#3724)

parent 3708b6f9
...@@ -8,6 +8,9 @@ const { check } = Authorized; ...@@ -8,6 +8,9 @@ const { check } = Authorized;
// Conversion router to menu. // Conversion router to menu.
function formatter(data, parentAuthority, parentName) { function formatter(data, parentAuthority, parentName) {
if (!data) {
return undefined;
}
return data return data
.map(item => { .map(item => {
if (!item.name || !item.path) { if (!item.name || !item.path) {
...@@ -75,6 +78,9 @@ const filterMenuData = menuData => { ...@@ -75,6 +78,9 @@ const filterMenuData = menuData => {
* @param {Object} menuData 菜单配置 * @param {Object} menuData 菜单配置
*/ */
const getBreadcrumbNameMap = menuData => { const getBreadcrumbNameMap = menuData => {
if (!menuData) {
return {};
}
const routerMap = {}; const routerMap = {};
const flattenMenuData = data => { const flattenMenuData = data => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment