jeecgboot/JeecgBoot · error · Error
地址错误, 配置ID不存在!
Error message
地址错误, 配置ID不存在!
What it means
Setup guard in the auto-style online TREE list. `ID` is the form code from `params.code ?? ''`; if empty it warns and throws at setup, because the tree list must load tree column/button configs keyed by that code (and immediately calls `onlineTableContext.isTree(true)` after this check).
Source
Thrown at jeecgboot-vue3/src/views/super/online/cgform/auto/tree/OnlineAutoTreeList.vue:241
handleChangeInTable,
loadData,
superQueryButtonRef,
superQueryStatus,
handleSuperQuery,
registerCustomModal,
getTreeDataByResult,
expandedRowKeys,
handleExpandedRowsChange,
tableReloading,
onlineExtConfigJson,
handleFormConfig,
pageLoading,
} = useOnlineTableContext();
if (!ID.value) {
$message.warning('地址错误, 配置ID不存在!');
// update-begin--author:liaozhiyang---date:20230825---for:【QQYUN-6326】部分代码找不到引用
throw new Error('地址错误, 配置ID不存在!');
// update-end--author:liaozhiyang---date:20230825---for:【QQYUN-6326】部分代码找不到引用
}
// 树列表特定方法调用
onlineTableContext.isTree(true);
// 处理增强
let { initCgEnhanceJs } = useEnhance(onlineTableContext);
// 处理列表button
const {
buttonSwitch,
cgLinkButtonList,
cgBIBtnMap,
getQueryButtonCfg,
getResetButtonCfg,
getFormConfirmButtonCfg,
cgTopButtonList,
importUrl,
registerModal,View on GitHub (pinned to 96fb33f5ec)
Solutions
- Open the tree list via the proper menu entry carrying `code`; confirm the URL has `code=<formCode>`.
- For a custom menu, include the online form code in the route path/query.
- In dev, append `?code=<yourFormCode>`.
- Add a router guard redirecting when `code` is missing instead of throwing at setup.
Example fix
// before
if (!ID.value) {
$message.warning('地址错误, 配置ID不存在!');
throw new Error('地址错误, 配置ID不存在!');
}
// after — guard + redirect at the route level
router.beforeEach((to) => {
if (to.meta?.isAutoTreeList && !to.query.code) {
return { name: 'ExceptionPage', query: { status: '404' } };
}
return true;
}); Defensive patterns
Strategy: validation
Validate before calling
// before rendering the tree 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
- Launch tree lists via the menu entry carrying `code`.
- Add a router.beforeEach guard for tree-list routes requiring `code`.
- Keep menu config in sync with the required param.
- Assert the URL contains a code in e2e tests.
When it happens
Trigger: The tree list route was opened WITHOUT the `code` param: direct navigation with no `?code=...`, a stale bookmark, a menu entry omitting `code`, or a redirect that stripped the query string.
Common situations: Bookmark to the tree list missing `code`; backend menu config lost the code; manual URL entry forgetting `code`; sub-app handoff dropped the param.
Related errors
AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14).
Data as JSON: /api/errors/7515db1786a2794b.
Report an issue: GitHub.