{"record":{"id":"9a11da7d381d4c09","repo":"jeecgboot/JeecgBoot","slug":"id-9a11da","errorCode":null,"errorMessage":"地址错误, 配置ID不存在!","messagePattern":"地址错误, 配置ID不存在!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineAutoList.vue","lineNumber":259,"sourceCode":"        getColumnList,\n        handleChangeInTable,\n        loadData,\n        superQueryButtonRef,\n        superQueryStatus,\n        handleSuperQuery,\n        onlineExtConfigJson,\n        handleFormConfig,\n        registerCustomModal,\n        tableReloading,\n        isConfigCurRoute,\n        pageLoading,\n      } = useOnlineTableContext();\n\n      // 判断 若ID不存在就终止后续逻辑\n      if (!ID.value) {\n        $message.warning('地址错误, 配置ID不存在!');\n        // update-end--author:liaozhiyang---date:20230825---for：【QQYUN-6326】部分代码找不到引用\n        throw new Error('地址错误, 配置ID不存在!');\n        // update-end--author:liaozhiyang---date:20230825---for：【QQYUN-6326】部分代码找不到引用\n      }\n      // 处理增强\n      let { initCgEnhanceJs } = useEnhance(onlineTableContext);\n      // 处理列表button\n      const {\n        buttonSwitch,\n        cgLinkButtonList,\n        cgBIBtnMap,\n        getQueryButtonCfg,\n        getResetButtonCfg,\n        getFormConfirmButtonCfg,\n        cgTopButtonList,\n        importUrl,\n        registerModal,\n        handleAdd,\n        handleEdit,\n        handleBatchDelete,","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineAutoList.vue#L241-L277","documentation":"Setup guard in the auto-style online cgform list component. `ID` is the online form code, sourced from `params.code ?? ''` in `useOnlineTableContext()`. At setup, if `ID.value` is empty it warns the user then throws to abort further rendering, because every later column/data/button-config API call needs that code.","triggerScenarios":"The component's route was opened WITHOUT the required `code` (online form id) param: navigating directly to the list route with no `?code=...`, a stale bookmark, a menu entry whose path/query omits `code`, or a redirect that stripped the query string.","commonSituations":"Bookmark/favorite to the list page missing `code`; backend menu config lost the code path variable; developer typing the route URL by hand and forgetting `code`; qiankun/sub-app handoff dropped the param.","solutions":["Open the page via the proper menu entry that carries `code`; confirm the URL contains `code=<formCode>`.","For a custom menu, make sure the route path/query includes the online form code (the `onl_cgform_head` code/id).","In dev, append `?code=<yourFormCode>` to the URL.","If the route is intentionally codeless, add a navigation guard that redirects before mount instead of throwing at setup."],"exampleFix":"// before\nif (!ID.value) {\n  $message.warning('地址错误, 配置ID不存在!');\n  throw new Error('地址错误, 配置ID不存在!');\n}\n\n// after — redirect to a safe page from a router guard instead of throwing during setup\nrouter.beforeEach((to) => {\n  if (to.meta?.isOnlineList && !to.query.code) {\n    return { name: 'ExceptionPage', query: { status: '404' } };\n  }\n  return true;\n});","handlingStrategy":"validation","validationCode":"// before rendering the list, confirm the route carries the online form code\nconst code = route.query.code as string | undefined;\nif (!code) {\n  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: 'missing-code' } });\n}","typeGuard":"const hasFormCode = (c: unknown): c is string => typeof c === 'string' && c.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Always launch online lists via the generated menu that carries `code`.","Add a router.beforeEach guard that redirects when `code` is missing for online-list routes.","Bookmarks/favorites must include the `code` query param.","In e2e tests, assert the list URL always contains a code."],"tags":["vue3","online-cgform","routing","config","setup-guard","typescript"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}