迁移合作订单完整能力,并统一 AppRoleCode 角色权限与首页菜单展示。
新增 CooperationOrder 模块(双 Tab 列表、获客员绑定、主 Tab 扫码)、订单来源/带客单绑定及配套 API 测试;同步引入 roleCode 权限匹配与相关单元测试。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -58,10 +58,15 @@ final class HomeViewModel: ObservableObject {
|
||||
]
|
||||
|
||||
/// 从角色权限树扁平化出菜单项,按固定顺序排序并按 URI 别名去重。
|
||||
func buildMenus(from permissions: [RolePermissionResponse], currentRoleId: Int?) {
|
||||
func buildMenus(from permissions: [RolePermissionResponse], currentRoleCode: String?) {
|
||||
let source: RolePermissionResponse?
|
||||
if let currentRoleId {
|
||||
source = permissions.first { $0.role.id == currentRoleId }
|
||||
if let currentRoleCode, !currentRoleCode.isEmpty {
|
||||
source = RolePermissionMatching.match(
|
||||
in: permissions,
|
||||
roleCode: currentRoleCode,
|
||||
roleId: nil,
|
||||
roleName: nil
|
||||
)
|
||||
} else {
|
||||
source = permissions.first
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user