From 7ed5f33e7bd9ca26fb41700e518234b973841921 Mon Sep 17 00:00:00 2001 From: AprilWind <2100166581@qq.com> Date: 星期三, 24 四月 2024 22:30:52 +0800 Subject: [PATCH] !107 add 新增岗位编码与部门编码 并将岗位放到部门下 * add 新增获取岗位选择框列表 * update 岗位查询树表和单表相互undefined * update 岗位查询增加单部门查询 * update 优化类别编码与后台一致性 * add 新增岗位部门树以及类别编码 * add 部门增加类别代码 --- src/utils/permission.ts | 60 ++++++++++++++++++++++++++++++------------------------------ 1 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/utils/permission.ts b/src/utils/permission.ts index 7b51dbc..eb3838a 100644 --- a/src/utils/permission.ts +++ b/src/utils/permission.ts @@ -6,23 +6,23 @@ * @returns {Boolean} */ export const checkPermi = (value: any) => { - if (value && value instanceof Array && value.length > 0) { - const permissions = useUserStore().permissions; - const permissionDatas = value; - const all_permission = '*:*:*'; + if (value && value instanceof Array && value.length > 0) { + const permissions = useUserStore().permissions; + const permissionDatas = value; + const all_permission = '*:*:*'; - const hasPermission = permissions.some((permission) => { - return all_permission === permission || permissionDatas.includes(permission); - }); + const hasPermission = permissions.some((permission) => { + return all_permission === permission || permissionDatas.includes(permission); + }); - if (!hasPermission) { - return false; - } - return true; - } else { - console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`); - return false; - } + if (!hasPermission) { + return false; + } + return true; + } else { + console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`); + return false; + } }; /** @@ -31,21 +31,21 @@ * @returns {Boolean} */ export const checkRole = (value: any): boolean => { - if (value && value instanceof Array && value.length > 0) { - const roles = useUserStore().roles; - const permissionRoles = value; - const super_admin = 'admin'; + if (value && value instanceof Array && value.length > 0) { + const roles = useUserStore().roles; + const permissionRoles = value; + const super_admin = 'admin'; - const hasRole = roles.some((role) => { - return super_admin === role || permissionRoles.includes(role); - }); + const hasRole = roles.some((role) => { + return super_admin === role || permissionRoles.includes(role); + }); - if (!hasRole) { - return false; - } - return true; - } else { - console.error(`need roles! Like checkRole="['admin','editor']"`); - return false; - } + if (!hasRole) { + return false; + } + return true; + } else { + console.error(`need roles! Like checkRole="['admin','editor']"`); + return false; + } }; -- Gitblit v1.9.3