feat: 完成多模块功能迭代与优化
本次提交包含多模块功能更新: 1. 权限系统重构:移除硬编码admin放行逻辑,新增精细化权限控制,完善权限树形结构与用户/角色保护 2. 新增物料导入导出接口,补充台账查询条件 3. 优化列表查询排序逻辑,新增区域编码大小写不敏感搜索 4. 修复帮助抽屉重复弹出问题,补充页面权限控制 5. 新增弱密码提示逻辑,优化MES/WMS用户/角色管理权限 6. 调整路由结构,新增权限校验脚本与前端权限树重构 7. 补充数据库字段与依赖包更新
This commit is contained in:
+3
-3
@@ -33,7 +33,7 @@ plist = perms.get("data", {}).get("list", [])
|
||||
codes = [p["code"] for p in plist]
|
||||
print("权限总数:", len(plist), "| MENU:", sum(1 for c in codes if c.endswith(':view') or c in ('dashboard:view','role:manage','user:manage')))
|
||||
print("menu去重内 sample:", [c for c in codes if c in ('inbound:view','inventory:view','role:manage')])
|
||||
print("BUTTON sample:", [c for c in codes if c in ('inbound:create','material:edit','*:export')])
|
||||
print("BUTTON sample:", [c for c in codes if c in ('inbound:create','material:edit','inbound:export','outbound:export','inspection:export','inventory:export')])
|
||||
assert "inbound:view" in codes, "缺 inbound:view"
|
||||
assert "inbound:create" in codes, "缺按钮权限"
|
||||
assert "package:view" not in codes, "废弃 package:view 未清除!"
|
||||
@@ -49,7 +49,7 @@ assert any(r["code"] == "admin" for r in rlist)
|
||||
print("\n=== 5) 新建自定义角色 test-role ===")
|
||||
_, cr = req("POST", "/api/roles", TOKEN, {
|
||||
"name": "E2E测试角色", "code": "e2e_test_role",
|
||||
"remark": "验证用", "permissionCodes": ["inventory:view", "*:export"]
|
||||
"remark": "验证用", "permissionCodes": ["inventory:view", "inventory:export"]
|
||||
})
|
||||
print("创建:", cr.get("code"), cr.get("message"))
|
||||
rid = cr.get("data", {}).get("id")
|
||||
@@ -57,7 +57,7 @@ assert rid, "创建角色失败"
|
||||
|
||||
print("\n=== 6a) 编辑角色(变更权限) ===")
|
||||
_, ur = req("POST", "/api/roles/update", TOKEN, {
|
||||
"id": rid, "name": "E2E测试角色改", "permissionCodes": ["inventory:view", "inbound:view", "*:export"]
|
||||
"id": rid, "name": "E2E测试角色改", "permissionCodes": ["inventory:view", "inbound:view", "inbound:export", "inventory:export"]
|
||||
})
|
||||
print("编辑:", ur.get("code"), ur.get("message"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user