From bc79c3e8341048ec604f414d9a0ecb875bae7698 Mon Sep 17 00:00:00 2001 From: 张晓波 <bingbo1993@126.com> Date: 星期一, 11 十二月 2023 16:33:43 +0800 Subject: [PATCH] 人脸记录去掉token验证 --- web/src/plugins/directive.js | 33 ++++++++++++++++++++------------- 1 files changed, 20 insertions(+), 13 deletions(-) diff --git a/web/src/plugins/directive.js b/web/src/plugins/directive.js index 08742f4..cbc0d89 100644 --- a/web/src/plugins/directive.js +++ b/web/src/plugins/directive.js @@ -1,13 +1,20 @@ -import Vue from 'vue' -import { buttonPinia } from '@/pinia/index' - -Vue.directive('permission', { - inserted: (el, binding) => { - const { value } = binding - const pinia = buttonPinia() - const piniaBtns = pinia.$state.buttonInfo - if (value && !piniaBtns.includes(value)) { - el.parentNode.removeChild(el) - } - } -}) +import Vue from 'vue' +import { buttonPinia } from '@/pinia/index' + +Vue.directive('permission', { + inserted: (el, binding) => { + const { value } = binding + if (!value) return + + const pinia = buttonPinia() + const piniaBtns = pinia.$state.buttonInfo + if (piniaBtns.includes(value)) { + value === 'insert' && (el.className += ' search_btn') + value === 'update' && (el.className += ' table_btn') + value === 'delete' && (el.className += ' delete_btn') + value === 'export' && (el.className += ' search_btn') + } else { + el.parentNode.removeChild(el) + } + } +}) -- Gitblit v1.9.3