From a44c82f937fb832f99f5f6a7a4919d0d5ca02855 Mon Sep 17 00:00:00 2001 From: iczer <1126263215@qq.com> Date: Thu, 27 Aug 2020 21:30:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20the=20exception=20of=20authority=20plugi?= =?UTF-8?q?n;=20:bug:=20=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=8F=92=E4=BB=B6=E5=BC=82=E5=B8=B8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/authority-plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/authority-plugin.js b/src/plugins/authority-plugin.js index 36996d43..f8e756fe 100644 --- a/src/plugins/authority-plugin.js +++ b/src/plugins/authority-plugin.js @@ -13,7 +13,7 @@ const getRoutePermission = (permissions, route) => permissions.find(item => item */ const getRouteRole = (roles, route) => { const requiredRoles = route.meta.authority.role - return roles.filter(item => requiredRoles.findIndex(required => required === item.id) !== -1) + return requiredRoles ? roles.filter(item => requiredRoles.findIndex(required => required === item.id) !== -1) : [] } /** * 判断是否已为方法注入权限认证