chore(system/storage): 完善存储管理权限指令

This commit is contained in:
2024-04-15 22:47:50 +08:00
parent 7a869bf9d1
commit 05f4580609
4 changed files with 28 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ import hasRole from './permission/hasRole'
export default {
install(Vue: App) {
Vue.directive('hasPerm', hasPerm)
Vue.directive('hasRole', hasRole)
Vue.directive('permission', hasPerm)
Vue.directive('role', hasRole)
}
}

View File

@@ -2,8 +2,8 @@ import type { DirectiveBinding, Directive } from 'vue'
import { useUserStore } from '@/stores'
/**
* @desc v-hasPerm 操作权限处理
* @desc 使用 v-hasPerm="['home:btn:add']"
* @desc v-permission 操作权限处理
* @desc 使用 v-permission="['system:user:add']"
*/
function checkPermission(el: HTMLElement, binding: DirectiveBinding) {
const userStore = useUserStore()