Commit ba4d78e1 by 张杰

修改权限按钮组件

1 parent a00e9582
...@@ -11,6 +11,10 @@ export default { ...@@ -11,6 +11,10 @@ export default {
type: [String, Number], type: [String, Number],
default: "", default: "",
}, },
name: {
type: String,
default: "",
},
type: { type: {
type: [String, Number], type: [String, Number],
default: "default", default: "default",
...@@ -23,14 +27,14 @@ export default { ...@@ -23,14 +27,14 @@ export default {
data() { data() {
return {}; return {};
}, },
mounted() { mounted() {},
},
methods: { methods: {
// 判断是否有权限 // 判断是否有权限
hasPermission() { hasPermission() {
let id = this.uid; let id = this.uid;
let _name = this.name;
let list = this.$root.parentCommon.getAuthData(); let list = this.$root.parentCommon.getAuthData();
let idx = list.findIndex((k) => k.id == id); let idx = list.findIndex((k) => k.id == id || k.label == _name);
if (idx < 0) { if (idx < 0) {
return false; return false;
} else { } else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!