jeecgboot/JeecgBoot · error · Error

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

Error message

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

What it means

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.

Source

Thrown at jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineFormUrlDetail.vue:48

  import OnlineDetailModal from './OnlineDetailModal.vue';
  import { useOnlineTableContext } from '../../hooks/auto/useOnlineTableContext';
  import { useListButton } from '../../hooks/auto/useListButton';
  import { useEnhance } from '../../hooks/auto/useEnhance';
  import { useFormUrl } from '../../hooks/auto/useFormUrl';
  const route = useRoute();
  const { ID, onlineTableContext, onlineExtConfigJson } = useOnlineTableContext();
  const { createMessage: $message } = useMessage();
  const wrapRef = ref(null);
  const contentHeight = ref(400);
  const loading = ref(true);

  const { token } = useFormUrl();
  if (!unref(token)) {
    throw new Error('token不存在~');
  }
  if (!ID.value || !route.params.dataId) {
    $message.warning('地址错误, 配置ID不存在!');
    throw new Error('地址错误, 配置ID不存在!');
  }
  watch(
    () => wrapRef.value,
    (elem: HTMLElement) => {
      // 获取页面实际高度
      contentHeight.value = elem.offsetHeight;
    }
  );
  // 处理增强
  let { initCgEnhanceJs } = useEnhance(onlineTableContext);
  // 处理列表button
  const { registerDetailModal, openDetailModal } = useListButton(onlineTableContext, onlineExtConfigJson);
  const getContainer = (node) => {
    return document.querySelector(`.online-detail-${ID.value}`);
  };
  setTimeout(() => {
    openDetailModal(true, {
      isUpdate: true,

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Ensure the detail URL carries both: `/online/form/<dataId>?code=<formCode>&token=<jwt>`.
  2. Verify the list's view action passes the selected row id into the `dataId` route param.
  3. Confirm the route definition declares `dataId` as a param and the name matches the check.
  4. Add a router guard redirecting when either param is missing.

Example fix

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

// after — split the checks for a precise message + redirect
if (!ID.value || !route.params.dataId) {
  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: !ID.value ? 'missing-code' : 'missing-dataId' } });
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

// confirm both the form code and the record id are present
if (!ID.value || !route.params.dataId) {
  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: !ID.value ? 'missing-code' : 'missing-dataId' } });
  return;
}

Type guard

const hasDetailParams = (code: unknown, dataId: unknown): boolean =>
  typeof code === 'string' && code.trim().length > 0 && typeof dataId === 'string' && dataId.length > 0;

Prevention

When it happens

Trigger: 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.

Common situations: 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`).

Related errors


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