From 63c36d14665ceca2fbd64d5ccbcff678f4fda386 Mon Sep 17 00:00:00 2001 From: yueli Date: Tue, 21 Jul 2026 09:59:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=80=9F=E5=BA=93=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E6=94=B9=E5=9B=9E=20null=EF=BC=88=E5=A7=8B?= =?UTF-8?q?=E7=BB=88=E5=8F=AF=E8=A7=81=EF=BC=89=EF=BC=8C=E6=9A=82=E7=AD=89?= =?UTF-8?q?=20sys=5Felement=20=E8=A1=A5=E9=BD=90=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-backend/app/api/v1/transactions.py | 7 ++----- inventory-web/src/views/transaction/records.vue | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/inventory-backend/app/api/v1/transactions.py b/inventory-backend/app/api/v1/transactions.py index d72056e..ae3f0d5 100644 --- a/inventory-backend/app/api/v1/transactions.py +++ b/inventory-backend/app/api/v1/transactions.py @@ -47,11 +47,8 @@ def filter_item_by_permissions(item_dict, user_permissions, prefix='op_records') ★ Fail-Closed: 字段映射默认为完整列表,不再为空字典。 """ - # 仅过滤敏感字段(签名),基础字段在 sys_element 补齐前不过滤 - field_to_perm = { - 'borrow_signature': f'{prefix}:borrow_signature', - 'return_signature': f'{prefix}:return_signature', - } + # sys_element 补齐前不做字段级过滤 + field_to_perm = {} if '*' in user_permissions or f'{prefix}:*' in user_permissions: return item_dict for field, perm_code in field_to_perm.items(): diff --git a/inventory-web/src/views/transaction/records.vue b/inventory-web/src/views/transaction/records.vue index 09ca7a8..238cb8f 100644 --- a/inventory-web/src/views/transaction/records.vue +++ b/inventory-web/src/views/transaction/records.vue @@ -183,9 +183,9 @@ const permissionMap: Record = { status: null, expected_return_time: null, return_location: null, - // 签名列 — 需要权限 - borrow_signature: 'op_records:borrow_signature', - return_signature: 'op_records:return_signature', + // 签名列 — 始终可见(sys_element 补齐后再改为显式权限码) + borrow_signature: null, + return_signature: null, } // 检查列权限