@@ -44,4 +44,13 @@ app.config.globalProperties.check = () => {
console.log("check");
};
+app.directive("auth", {
+ mounted(el, bind) {
+ let permissions = store.state.userPermission;
+ if (permissions.indexOf(bind.value) == -1) {
+ el.parentNode.removeChild(el);
+ }
+ },
+});
+
app.use(router).use(ElementPlus).use(store).mount("#app");
@@ -11,7 +11,9 @@
></el-input>
<div class="seach-btn" @click="getSubAccountList">查询</div>
</div>
- <el-button type="primary" @click="visable = true">添加账号</el-button>
+ <el-button v-auth="'ADDPROXY'" type="primary" @click="visable = true"
+ >添加账号</el-button
+ >
<el-dialog