diff --git a/src/directives/auth.js b/src/directives/auth.js
new file mode 100644
index 00000000..660bcc87
--- /dev/null
+++ b/src/directives/auth.js
@@ -0,0 +1,22 @@
+import permission from '@/utils/permission'
+
+export default {
+ mounted(el, binding) {
+ const { value } = binding
+ if(Array.isArray(value)){
+ let ishas = false;
+ value.forEach(item => {
+ if(permission(item)){
+ ishas = true;
+ }
+ })
+ if (!ishas){
+ el.parentNode.removeChild(el)
+ }
+ }else{
+ if(!permission(value)){
+ el.parentNode.removeChild(el);
+ }
+ }
+ }
+};
diff --git a/src/main.js b/src/main.js
index 4d2734a8..042cfedf 100644
--- a/src/main.js
+++ b/src/main.js
@@ -17,6 +17,7 @@ import scUpload from './components/scUpload'
import scUploadMultiple from './components/scUpload/multiple'
import scFormTable from './components/scFormTable'
import scTableSelect from './components/scTableSelect'
+import auth from './directives/auth'
const app = createApp(App);
@@ -24,7 +25,7 @@ app.config.globalProperties.$CONFIG = config;
app.config.globalProperties.$TOOL = tool;
app.config.globalProperties.$HTTP = http;
app.config.globalProperties.$API = api;
-app.config.globalProperties.$HAS = permission;
+app.config.globalProperties.$AUTH = permission;
app.use(store);
app.use(router);
@@ -37,4 +38,6 @@ app.component('scUploadMultiple', scUploadMultiple);
app.component('scFormTable', scFormTable);
app.component('scTableSelect', scTableSelect);
+app.directive('auth', auth)
+
app.mount('#app');
diff --git a/src/views/other/directive.vue b/src/views/other/directive.vue
new file mode 100644
index 00000000..1013d139
--- /dev/null
+++ b/src/views/other/directive.vue
@@ -0,0 +1,15 @@
+
+