From ea604783043942a7281dcb66f5d19ebf887ddad5 Mon Sep 17 00:00:00 2001 From: dyz <43943819+dyzsoft@users.noreply.github.com> Date: Sun, 5 Jul 2020 13:12:46 +0800 Subject: [PATCH] perf[permission.js]: remove useless code (#3301) --- src/utils/permission.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils/permission.js b/src/utils/permission.js index 221d3842..8e2bbada 100644 --- a/src/utils/permission.js +++ b/src/utils/permission.js @@ -13,11 +13,7 @@ export default function checkPermission(value) { const hasPermission = roles.some(role => { return permissionRoles.includes(role) }) - - if (!hasPermission) { - return false - } - return true + return hasPermission } else { console.error(`need roles! Like v-permission="['admin','editor']"`) return false