Skip to content

Commit

Permalink
perf[permission.js]: remove useless code (PanJiaChen#3301)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyzsoft authored Jul 5, 2020
1 parent fe22b3c commit ea60478
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/utils/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea60478

Please sign in to comment.