Skip to content

Commit

Permalink
fix: the exception of authority plugin; 🐛
Browse files Browse the repository at this point in the history
修复:权限认证插件异常问题;
  • Loading branch information
iczer committed Aug 27, 2020
1 parent 902afbe commit a44c82f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/authority-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) : []
}
/**
* 判断是否已为方法注入权限认证
Expand Down

0 comments on commit a44c82f

Please sign in to comment.