From 32918e44e9ca0c877761f168d44f2134c7c2d204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8B=B7=E9=92=89?= <41830859@qq.com> Date: Thu, 14 Mar 2019 09:33:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9C=89=E5=A4=9A?= =?UTF-8?q?=E4=B8=AAlayout=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=85=B6?= =?UTF-8?q?=E4=B8=AD=E4=B8=80=E4=B8=AAlayout=E4=B8=AD=E6=B2=A1=E6=9C=89rou?= =?UTF-8?q?tes=EF=BC=8C=E5=B0=86=E5=8F=91=E6=94=B6=E5=88=B0=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AAlayout=E7=9A=84=E8=8F=9C=E5=8D=95=20(#3724)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/menu.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/models/menu.js b/src/models/menu.js index 55e7909c..2e803f06 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 => { -- GitLab