From b2c8062131ceb9bf2061594dd54cdfc20da3a05e Mon Sep 17 00:00:00 2001 From: water <2778335106@qq.com> Date: 星期五, 20 五月 2022 17:09:28 +0800 Subject: [PATCH] style 修改一个错误的参数注释 public R<Void> remove(@ApiParam("岗位ID串") @PathVariable Long[] roleIds) { return toAjax(roleService.deleteRoleByIds(roleIds)); } --- 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