jeecgboot/JeecgBoot · error · Error
地址错误, 配置ID不存在!
Error message
地址错误, 配置ID不存在!
What it means
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.
Source
Thrown at jeecgboot-vue3/src/views/super/online/cgform/auto/default/OnlineFormUrlEdit.vue:50
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 { ID, onlineTableContext, onlineExtConfigJson, handleFormConfig } = useOnlineTableContext();
const { createMessage: $message } = useMessage();
const route = useRoute();
const wrapRef = ref(null);
const contentHeight = ref(400);
const loading = ref(true);
const router = useRouter();
const { token } = useFormUrl();
if (!unref(token)) {
throw new Error('token不存在~');
}
if (!ID.value || !route.params.dataId) {
$message.warning('地址错误, 配置ID不存在!');
throw new Error('地址错误, 配置ID不存在!');
}
// 处理增强
let { initCgEnhanceJs } = useEnhance(onlineTableContext);
watch(
() => wrapRef.value,
(elem: HTMLElement) => {
// 获取页面实际高度
contentHeight.value = elem.offsetHeight - 60;
}
);
// 处理列表button
const { registerModal, handleEdit } = useListButton(onlineTableContext, onlineExtConfigJson);
const getContainer = (node) => {
return document.querySelector(`.online-edit-${ID.value}`);
};
const success = () => {
setTimeout(() => {
handleEdit({ id: route.params.dataId });View on GitHub (pinned to 96fb33f5ec)
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.
Example fix
// before
if (!ID.value || !route.params.dataId) {
$message.warning('地址错误, 配置ID不存在!');
throw new Error('地址错误, 配置ID不存在!');
}
// after — precise 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 hasEditParams = (code: unknown, dataId: unknown): boolean => typeof code === 'string' && code.trim().length > 0 && typeof dataId === 'string' && dataId.length > 0;
Prevention
- 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`.
When it happens
Trigger: 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`.
Common situations: Custom 'edit' button constructed a URL without `dataId`; deep-link bookmark to an edit form missing the id; route param renamed.
Related errors
AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14).
Data as JSON: /api/errors/05822b0c178b16d2.
Report an issue: GitHub.