openxiangda 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli.js CHANGED
@@ -1945,9 +1945,9 @@ function resolvePagePermissionMenuTargets(bound, flags = {}) {
1945
1945
 
1946
1946
  function resolveMenuPermissionTargets(bound, menuCode) {
1947
1947
  const menuEntry = bound.resources?.menus?.[menuCode];
1948
- const menuId = resolveMenuId(bound, menuCode);
1949
1948
  if (menuEntry?.formUuid) return [menuEntry.formUuid];
1950
- return [menuId];
1949
+ if (menuEntry?.pageId && menuEntry?.menuId) return [menuEntry.menuId];
1950
+ return [resolveMenuId(bound, menuCode)];
1951
1951
  }
1952
1952
 
1953
1953
  function resolvePagePermissionTargets(bound, pageCode) {
@@ -1955,7 +1955,7 @@ function resolvePagePermissionTargets(bound, pageCode) {
1955
1955
  if (menuEntry?.menuId) {
1956
1956
  return [menuEntry.menuId];
1957
1957
  }
1958
- fail(`页面 ${pageCode} 未找到已绑定菜单。请先发布/创建菜单,或直接传 --menu-codes/--menu-ids。`);
1958
+ fail(`页面 ${pageCode} 未找到已绑定代码页菜单。请先发布/创建菜单,或直接传 --menu-form-uuids/--menu-ids。`);
1959
1959
  }
1960
1960
 
1961
1961
  function resolvePagePermissionRuntimeAliasTargets(bound, flags = {}) {
@@ -2001,9 +2001,11 @@ function resolveCodePagePermissionAliases(bound, menuEntry = {}, pageCode) {
2001
2001
  });
2002
2002
  return unique([
2003
2003
  pageCode,
2004
+ menuEntry.pageId,
2004
2005
  menuEntry.pageCode,
2005
2006
  menuEntry.routeKey,
2006
2007
  menuEntry.legacyFormUuid,
2008
+ pageEntry?.pageId,
2007
2009
  pageEntry?.pageCode,
2008
2010
  pageEntry?.routeKey,
2009
2011
  pageEntry?.legacyFormUuid,
@@ -373,7 +373,7 @@ Body:
373
373
  }
374
374
  ```
375
375
 
376
- An empty `menuFormUuids` array means all menus/pages are visible to the matched roles. For form menus this field can contain form UUIDs. For custom code page menus, the user-facing permission group should contain only the actual menu ID used by the platform admin tree. Because the current `/view` runtime guard also checks route keys and legacy `PAGE_...` aliases, OpenXiangda CLI `--page-codes` / `--menu-codes` creates a companion `(运行时别名)` page permission group for those aliases instead of mixing them into the editable menu group.
376
+ An empty `menuFormUuids` array means all menus/pages are visible to the matched roles. For form menus this field can contain form UUIDs. For custom code page menus, the user-facing permission group should contain the platform menu ID, which is what the platform permission editor uses for tree check state. Because some `/view` runtime guards also check page IDs, route keys, and legacy `PAGE_...` aliases, OpenXiangda CLI `--page-codes` / `--menu-codes` creates a companion `(运行时别名)` page permission group for those aliases instead of mixing them into the editable menu group.
377
377
 
378
378
  ### GET `/apps/:appType/page-permission-groups/:groupId`
379
379
 
@@ -20,8 +20,8 @@ Role IDs are platform-specific. Store them only in `.openxiangda/state.json` und
20
20
 
21
21
  Page permission groups map role codes to visible menu targets. Form menus use their `FORM_...`
22
22
  form UUIDs. Custom code page/display menus need split targets because current platform
23
- surfaces check different identifiers: the admin edit tree expects menu IDs, while `/view`
24
- runtime checks route keys and legacy `PAGE_...` aliases.
23
+ surfaces check different identifiers: the admin edit tree expects menu IDs, while some `/view`
24
+ runtime guards check page IDs, route keys, and legacy `PAGE_...` aliases.
25
25
 
26
26
  ```json
27
27
  {
@@ -38,7 +38,7 @@ companion runtime alias group with the same roles:
38
38
  {
39
39
  "name": "销售页面(运行时别名)",
40
40
  "roles": ["sales"],
41
- "menuFormUuids": ["CODE_PAGE_ROUTE_KEY", "PAGE_LEGACY_FORM_UUID"]
41
+ "menuFormUuids": ["PAGE_ID_FOR_CODE_PAGE", "CODE_PAGE_ROUTE_KEY", "PAGE_LEGACY_FORM_UUID"]
42
42
  }
43
43
  ```
44
44
 
@@ -43,7 +43,7 @@ openxiangda permission page-group-create sales_pages --name "销售页面" --rol
43
43
  openxiangda permission page-group-create portal_pages --name "门户页面" --page-codes portal_pc,portal_mobile --profile dev
44
44
  ```
45
45
 
46
- Use `--page-codes` or `--menu-codes` for custom code page menus; the CLI resolves code pages to the published menu ID plus the route key and legacy `PAGE_...` alias required by the platform's current admin tree, `/view` guard, and custom-page bootstrap checks. Use `--form-codes` for form menus; the CLI resolves forms to profile-local form UUIDs. Empty target lists mean all menus/pages are visible to matched roles.
46
+ Use `--page-codes` or `--menu-codes` for custom code page menus; the CLI resolves the editable permission group to the published code page `pageId`, and creates a companion `(运行时别名)` group for the menu ID, route key, and legacy `PAGE_...` alias required by the platform's current `/view` guard and custom-page bootstrap checks. Use `--form-codes` for form menus; the CLI resolves forms to profile-local form UUIDs. Empty target lists mean all menus/pages are visible to matched roles.
47
47
 
48
48
  ## Form Permission Groups
49
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {