jeecgboot/JeecgBoot · error · Error

地址错误, 配置ID不存在!

Error message

地址错误, 配置ID不存在!

What it means

Setup guard in the ERP-style (one-to-many master/child) online list. `ID` is the form code from `params.code ?? ''`; if empty it warns and throws to abort rendering, because the ERP list must load both master and child column configs keyed by that code.

Solutions

  1. Open the ERP list via the proper menu entry carrying `code`; confirm the URL has `code=<formCode>`.
  2. For a custom ERP menu, include the online form code in the route path/query.
  3. In dev, append `?code=<yourFormCode>`.
  4. Add a router guard that redirects when `code` is missing instead of throwing at setup.

Example fix

// before
if (!ID.value) {
  $message.warning('地址错误, 配置ID不存在!');
  throw new Error('地址错误, 配置ID不存在!');
}

// after — router-level guard + redirect
router.beforeEach((to) => {
  if (to.meta?.isErpList && !to.query.code) {
    return { name: 'ExceptionPage', query: { status: '404' } };
  }
  return true;
});
Defensive patterns

Strategy: validation

Validate before calling

// before rendering the ERP list, confirm the route carries the online form code
const code = route.query.code as string | undefined;
if (!code) {
  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: 'missing-code' } });
}

Type guard

const hasFormCode = (c: unknown): c is string => typeof c === 'string' && c.trim().length > 0;

Prevention

When it happens

Trigger: The ERP list route was opened WITHOUT the `code` param: direct navigation with no `?code=...`, a stale bookmark, a menu entry whose path/query omits `code`, or a redirect that stripped the query string.

Common situations: Bookmark to the ERP list missing `code`; backend menu config lost the code path variable; manual URL entry forgetting `code`; qiankun/sub-app handoff dropped the param.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/950b69b060d09ccb. Report an issue: GitHub.

Appendix: source

Thrown at jeecgboot-vue3/src/views/super/online/cgform/auto/erp/OnlCgformErpList.vue:277

    if (selectedKeys.value.length > 0) {
      // 【TV360X-2701】选中的数据在当前页数据中不存在就清空选中
      selectedKeys.value = selectedKeys.value.filter((key) => value.some((item) => item['jeecg_row_key'] === key));
    }
    // update-begin--author:liaozhiyang---date:20250722---for:【issues/8575】erp默认选中第一个及没选中主表时子表不查询
    if (pagination.value.current == 1 && selectedKeys.value.length === 0) {
      setTimeout(() => {
        const tableTbodyElem = document.querySelector('.ant-table-wrapper .ant-table-tbody');
        tableTbodyElem?.querySelector('.ant-table-row')?.click();
      }, 100);
    }
    // update-end--author:liaozhiyang---date:20250722---for:【issues/8575】erp默认选中第一个及没选中主表时子表不查询
  });

  // 判断 若ID不存在就终止后续逻辑
  if (!ID.value) {
    $message.warning('地址错误, 配置ID不存在!');
    // update-end--author:liaozhiyang---date:20230825---for:【QQYUN-6326】部分代码找不到引用
    throw new Error('地址错误, 配置ID不存在!');
    // update-end--author:liaozhiyang---date:20230825---for:【QQYUN-6326】部分代码找不到引用

  }
  // 处理增强
  let { initCgEnhanceJs } = useEnhance(onlineTableContext);
  // 处理列表button
  const {
    buttonSwitch,
    cgLinkButtonList,
    cgBIBtnMap,
    getQueryButtonCfg,
    getResetButtonCfg,
    getFormConfirmButtonCfg,
    cgTopButtonList,
    importUrl,
    registerModal,
    handleAdd,
    handleEdit,

View on GitHub (pinned to 96fb33f5ec)