perf[permission.js]: remove useless code (#3301)

This commit is contained in:
dyz 2020-07-05 13:12:46 +08:00 committed by GitHub
parent fe22b3cd94
commit ea60478304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -13,11 +13,7 @@ export default function checkPermission(value) {
const hasPermission = roles.some(role => { const hasPermission = roles.some(role => {
return permissionRoles.includes(role) return permissionRoles.includes(role)
}) })
return hasPermission
if (!hasPermission) {
return false
}
return true
} else { } else {
console.error(`need roles! Like v-permission="['admin','editor']"`) console.error(`need roles! Like v-permission="['admin','editor']"`)
return false return false