mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-04-22 11:26:22 +08:00
优化按钮权限控制
This commit is contained in:
parent
2f83751e3a
commit
de3fab92f8
@ -2,11 +2,11 @@
|
|||||||
const hasPermission = {
|
const hasPermission = {
|
||||||
install(app) {
|
install(app) {
|
||||||
app.directive('permission', {
|
app.directive('permission', {
|
||||||
beforeMount(el, binding) {
|
mounted(el, binding) {
|
||||||
if (binding.value) {
|
if (binding.value) {
|
||||||
const permissionList = app.config.globalProperties.$global.user.authorities
|
const permissionList = app.config.globalProperties.$global.user.authorities
|
||||||
if (permissionList && permissionList.length && !permissionList.includes(binding.value) && import.meta.env.MODE != 'demo') {
|
if (permissionList && permissionList.length && !permissionList.includes(binding.value) && import.meta.env.MODE != 'demo') {
|
||||||
el.style.display = 'none'
|
el.remove()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user