From ae3ec0b26936b7883886aeee918e1a4d95dc41c9 Mon Sep 17 00:00:00 2001 From: taiyi Date: Fri, 29 May 2026 09:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E4=BB=B7=E8=A7=84?= =?UTF-8?q?=E5=88=99=E9=A1=B5=E9=9D=A2=E7=AE=A1=E7=90=86=E5=91=98=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E6=9D=83=E9=99=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 定价规则 API 使用了 master-data:list 和 master-data:update 权限码, 但这两个码未在菜单和默认权限中注册,导致管理员访问时被拒绝。 在 bootstrap 菜单中新增对应菜单项,并为 admin 和 manager 角色补上权限。 Co-Authored-By: Claude Opus 4.7 --- backend/app/services/auth_service.py | 4 ++++ backend/app/services/bootstrap.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/backend/app/services/auth_service.py b/backend/app/services/auth_service.py index a37f6e8..6aece39 100644 --- a/backend/app/services/auth_service.py +++ b/backend/app/services/auth_service.py @@ -35,6 +35,8 @@ class AuthService: "report:performance:export", "ai:recognize", "ai:correct", + "master-data:list", + "master-data:update", ], "driver": [ "driver:task:list", @@ -75,6 +77,8 @@ class AuthService: "customer:list", "customer:create", "customer:update", + "master-data:list", + "master-data:update", ], } diff --git a/backend/app/services/bootstrap.py b/backend/app/services/bootstrap.py index 3749cc3..9cffbbd 100644 --- a/backend/app/services/bootstrap.py +++ b/backend/app/services/bootstrap.py @@ -71,6 +71,8 @@ DEFAULT_MENUS = [ {"id": 32, "parent_id": 31, "menu_name": "物流轨迹新增", "menu_path": "", "menu_type": "button", "permission_code": "logistics:trace:create", "icon": "", "sort_no": 32, "status": 1}, {"id": 33, "parent_id": 0, "menu_name": "AI识别", "menu_path": "/ai", "menu_type": "page", "permission_code": "ai:recognize", "icon": "ai", "sort_no": 33, "status": 1}, {"id": 34, "parent_id": 33, "menu_name": "AI结果修正", "menu_path": "", "menu_type": "button", "permission_code": "ai:correct", "icon": "", "sort_no": 34, "status": 1}, + {"id": 35, "parent_id": 4, "menu_name": "定价规则查看", "menu_path": "", "menu_type": "button", "permission_code": "master-data:list", "icon": "", "sort_no": 35, "status": 1}, + {"id": 36, "parent_id": 4, "menu_name": "定价规则编辑", "menu_path": "", "menu_type": "button", "permission_code": "master-data:update", "icon": "", "sort_no": 36, "status": 1}, ] DEFAULT_ADMIN_USER = {