release(custom): i

This commit is contained in:
2023-10-10 15:01:00 +08:00
parent a9707c6d94
commit 5b33290de6
78 changed files with 13003 additions and 5230 deletions

View File

@@ -18,6 +18,27 @@ async function setupApp() {
await setupRouter(app)
app.directive('perms', {
mounted: (el, binding) => {
const { value } = binding
const permissions = JSON.parse(localStorage.getItem('roles'))
const all_permission = '*'
if (Array.isArray(value)) {
if (value.length > 0) {
const hasPermission = permissions.some((key) => {
return all_permission == key || value.includes(key)
})
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
}
} else {
throw new Error('like v-perms="[\'auth/menu/edit\']"')
}
},
})
app.mount('#app')
}