检测脚本

This commit is contained in:
sjl
2024-11-20 15:13:50 +08:00
parent c46a55e9c4
commit 55383cf501
21 changed files with 74 additions and 56 deletions

View File

@@ -10,6 +10,8 @@ const auth: Directive = {
const { value } = binding
const authStore = useAuthStore()
const currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? []
console.log('1234',authStore.routeName)
console.log('123',currentPageRoles)
if (value instanceof Array && value.length) {
const hasPermission = value.every(item => currentPageRoles.includes(item))
if (!hasPermission) el.remove()