From b461c8cc99dd46f4d76efb48626bbea8ac223661 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 01 九月 2021 15:38:08 +0800
Subject: [PATCH] update spring-boot-admin 2.5.0 => 2.5.1 update aliyun.oss 3.13.0 => 3.13.1 update qcloud.cos 5.6.47 => 5.6.51 update hutool 5.7.9 => 5.7.11 update maven-jar-plugin 3.1.1 => 3.2.0

---
 ruoyi-ui/src/directive/permission/hasPermi.js |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/ruoyi-ui/src/directive/permission/hasPermi.js b/ruoyi-ui/src/directive/permission/hasPermi.js
new file mode 100644
index 0000000..7101e3e
--- /dev/null
+++ b/ruoyi-ui/src/directive/permission/hasPermi.js
@@ -0,0 +1,28 @@
+ /**
+ * v-hasPermi 鎿嶄綔鏉冮檺澶勭悊
+ * Copyright (c) 2019 ruoyi
+ */
+
+import store from '@/store'
+
+export default {
+  inserted(el, binding, vnode) {
+    const { value } = binding
+    const all_permission = "*:*:*";
+    const permissions = store.getters && store.getters.permissions
+
+    if (value && value instanceof Array && value.length > 0) {
+      const permissionFlag = value
+
+      const hasPermissions = permissions.some(permission => {
+        return all_permission === permission || permissionFlag.includes(permission)
+      })
+
+      if (!hasPermissions) {
+        el.parentNode && el.parentNode.removeChild(el)
+      }
+    } else {
+      throw new Error(`璇疯缃搷浣滄潈闄愭爣绛惧�糮)
+    }
+  }
+}

--
Gitblit v1.9.3