hejianhao
2025-02-27 96cf4a62fd89d8d3fe7e9440c415e9dd13a91202
权限bug
2个文件已修改
48 ■■■■■ 已修改文件
management/src/pages/Login/index.tsx 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/setting/user/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/Login/index.tsx
@@ -74,9 +74,47 @@
    });
    const userInfo = { userName: data.name };
    localStorage.setItem('userInfo', JSON.stringify(userInfo));
    let permissionList: any[] = [
      "/work_order_transaction_management/work_order_item_configuration",
      "/work_order_transaction_management",
      "/system_setting/role_management/edit",
      "/work_order_transaction_management/banner_management",
      "/work_order_transaction_management/banner_management/del",
      "/system_setting/position_management/add",
      "/message_notification/mark_read",
      "/system_setting/role_management",
      "/system_setting/unit_management/del",
      "/system_setting/people_management/freeze",
      "/work_order_transaction_management/problem_type_management",
      "/system_setting/position_management/edit",
      "/system_setting/people_management/del",
      "/work_order_transaction_management/problem_type_management/edit",
      "/position_management/del",
      "/system_setting/unit_management/edit",
      "/system_setting/people_management/edit",
      "/work_order_transaction_management/problem_type_management/add",
      "/system_setting/unit_management/add",
      "/system_setting/people_management/detail",
      "/system_setting/role_management/detail",
      "/system_setting/unit_management",
      "/message_notification",
      "/system_setting/role_management/add",
      "/work_order_transaction_management/banner_management/edit",
      "/system_setting/role_management/del",
      "/work_order_transaction_management/problem_type_management/del",
      "/system_setting/people_management/add",
      "/work_order_transaction_management/banner_management/add",
      "/system_setting/position_management",
      "/system_setting",
      "/system_setting/people_management",
    ];
    let accessObj: any = {};
    data.menu.map((item) => {
      accessObj[item] = true
    permissionList.map((item) => {
      if (JSON.stringify(data.menu) === JSON.stringify(['*:*:*'])) {
        accessObj[item] = true;
      } else {
        accessObj[item] = data.menu.includes(item);
      }
    });
    
management/src/pages/setting/user/index.jsx
@@ -50,6 +50,7 @@
        <span>{item.name}</span>
        <div>
          {item.tier < 4 && (
            <Access accessible={access['/system_setting/unit_management/add']}>
            <PlusOutlined
              onClick={(e) => {
                e.stopPropagation();
@@ -57,7 +58,9 @@
                handleModalVisibles1(true);
              }}
            />
            </Access>
          )}
          <Access accessible={access['/system_setting/unit_management/edit']}>
          <EditOutlined
            onClick={(e) => {
              e.stopPropagation();
@@ -65,6 +68,8 @@
              handleModalVisibles1(true);
            }}
          />
          </Access>
          <Access accessible={access['/system_setting/unit_management/del']}>
          <DeleteOutlined
            onClick={(e) => {
              e.stopPropagation();
@@ -76,6 +81,7 @@
              }, '确认删除该单位吗?');
            }}
          />
          </Access>
        </div>
      </div>
    );