{"record":{"id":"cd1ca98ece5e2114","repo":"jeecgboot/JeecgBoot","slug":"id-cd1ca9","errorCode":null,"errorMessage":"地址错误, 配置ID不存在!","messagePattern":"地址错误, 配置ID不存在!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineFormUrlDetail.vue","lineNumber":48,"sourceCode":"  import OnlineDetailModal from './OnlineDetailModal.vue';\n  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 route = useRoute();\n  const { ID, onlineTableContext, onlineExtConfigJson } = useOnlineTableContext();\n  const { createMessage: $message } = useMessage();\n  const wrapRef = ref(null);\n  const contentHeight = ref(400);\n  const loading = ref(true);\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  watch(\n    () => wrapRef.value,\n    (elem: HTMLElement) => {\n      // 获取页面实际高度\n      contentHeight.value = elem.offsetHeight;\n    }\n  );\n  // 处理增强\n  let { initCgEnhanceJs } = useEnhance(onlineTableContext);\n  // 处理列表button\n  const { registerDetailModal, openDetailModal } = useListButton(onlineTableContext, onlineExtConfigJson);\n  const getContainer = (node) => {\n    return document.querySelector(`.online-detail-${ID.value}`);\n  };\n  setTimeout(() => {\n    openDetailModal(true, {\n      isUpdate: true,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineFormUrlDetail.vue#L30-L66","documentation":"Second setup guard in the URL-style online Detail form. Throws if EITHER the form `code` (`ID.value`) OR `route.params.dataId` (the record id to display) is missing — Detail needs both to fetch the specific record.","triggerScenarios":"Route lacks `code` and/or the `dataId` path param: a detail deep link missing the record id, a route definition that doesn't expose `dataId`, or a custom view button that built the URL without the row id.","commonSituations":"Custom 'view detail' button constructed a URL without `dataId`; deep-link bookmark to a detail missing the id; route param renamed (e.g. `id` vs `dataId`).","solutions":["Ensure the detail URL carries both: `/online/form/<dataId>?code=<formCode>&token=<jwt>`.","Verify the list's view action passes the selected row id into the `dataId` route param.","Confirm the route definition declares `dataId` as a param 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 — split the checks for a precise message + 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 hasDetailParams = (code: unknown, dataId: unknown): boolean =>\n  typeof code === 'string' && code.trim().length > 0 && typeof dataId === 'string' && dataId.length > 0;","tryCatchPattern":null,"preventionTips":["Url-detail links must carry `token`, `code`, and `dataId`.","List 'view' 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","detail","typescript"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}