{"record":{"id":"05822b0c178b16d2","repo":"jeecgboot/JeecgBoot","slug":"id-05822b","errorCode":null,"errorMessage":"地址错误, 配置ID不存在!","messagePattern":"地址错误, 配置ID不存在!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineFormUrlEdit.vue","lineNumber":50,"sourceCode":"  import { useOnlineTableContext } from '../../hooks/auto/useOnlineTableContext';\n  import { useListButton } from '../../hooks/auto/useListButton';\n  import { useEnhance } from '../../hooks/auto/useEnhance';\n  import { useFormUrl } from '../../hooks/auto/useFormUrl';\n  const { ID, onlineTableContext, onlineExtConfigJson, handleFormConfig } = useOnlineTableContext();\n  const { createMessage: $message } = useMessage();\n  const route = useRoute();\n  const wrapRef = ref(null);\n  const contentHeight = ref(400);\n  const loading = ref(true);\n  const router = useRouter();\n\n  const { token } = useFormUrl();\n  if (!unref(token)) {\n    throw new Error('token不存在~');\n  }\n  if (!ID.value || !route.params.dataId) {\n    $message.warning('地址错误, 配置ID不存在!');\n    throw new Error('地址错误, 配置ID不存在!');\n  }\n  // 处理增强\n  let { initCgEnhanceJs } = useEnhance(onlineTableContext);\n  watch(\n    () => wrapRef.value,\n    (elem: HTMLElement) => {\n      // 获取页面实际高度\n      contentHeight.value = elem.offsetHeight - 60;\n    }\n  );\n  // 处理列表button\n  const { registerModal, handleEdit } = useListButton(onlineTableContext, onlineExtConfigJson);\n  const getContainer = (node) => {\n    return document.querySelector(`.online-edit-${ID.value}`);\n  };\n  const success = () => {\n    setTimeout(() => {\n      handleEdit({ id: route.params.dataId });","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineFormUrlEdit.vue#L32-L68","documentation":"Second setup guard in the URL-style online Edit form. Throws if EITHER the form `code` (`ID.value`) OR `route.params.dataId` (the record id to load into the form) is missing — Edit needs both to fetch the record for editing.","triggerScenarios":"Route lacks `code` and/or the `dataId` path param: an edit deep link missing the record id, a custom edit action that built the URL without the row id, or a route definition that doesn't expose `dataId`.","commonSituations":"Custom 'edit' button constructed a URL without `dataId`; deep-link bookmark to an edit form missing the id; route param renamed.","solutions":["Ensure the edit URL carries both: `/online/form/<dataId>/edit?code=<formCode>&token=<jwt>`.","Verify the list's edit action passes the selected row id into `dataId`.","Confirm the route definition declares `dataId` and the name matches the check.","Add a router guard redirecting when either param is missing."],"exampleFix":"// before\nif (!ID.value || !route.params.dataId) {\n  $message.warning('地址错误, 配置ID不存在!');\n  throw new Error('地址错误, 配置ID不存在!');\n}\n\n// after — precise redirect\nif (!ID.value || !route.params.dataId) {\n  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: !ID.value ? 'missing-code' : 'missing-dataId' } });\n  return;\n}","handlingStrategy":"validation","validationCode":"// confirm both the form code and the record id are present\nif (!ID.value || !route.params.dataId) {\n  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: !ID.value ? 'missing-code' : 'missing-dataId' } });\n  return;\n}","typeGuard":"const hasEditParams = (code: unknown, dataId: unknown): boolean =>\n  typeof code === 'string' && code.trim().length > 0 && typeof dataId === 'string' && dataId.length > 0;","tryCatchPattern":null,"preventionTips":["Url-edit links must carry `token`, `code`, and `dataId`.","List 'edit' actions must pass the selected row id into `dataId`.","Validate required params in a router guard before mount.","Confirm route definitions declare `dataId`."],"tags":["vue3","online-cgform","routing","config","setup-guard","url-form","edit","typescript"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}