diff --git a/src/components/PublishModal.tsx b/src/components/PublishModal.tsx index 01fee28..90535af 100644 --- a/src/components/PublishModal.tsx +++ b/src/components/PublishModal.tsx @@ -276,8 +276,11 @@ export function PublishModal({ ); const modrinthRows: ModrinthTableRow[] = useMemo(() => { + // 行 key 发布时会作为 mc_version 直接传入后端 API,严禁加任何前缀: + // 此处曾加 "pending-" 前缀,导致后端准备阶段报 Invalid SemVer: "pending-1.19"。 + // 教训:所有要传入 API 的 key 都不能加前缀(行类型区分请用 kind 字段)。 const pending: ModrinthTableRow[] = publishVersions.map((v) => ({ - key: `pending-${v.key}`, + key: v.key, kind: "pending", pending: v, modrinthVersion: v.modrinthVersion, @@ -316,8 +319,11 @@ export function PublishModal({ ); const curseforgeRows: CurseforgeTableRow[] = useMemo(() => { + // 行 key 发布时会作为 mc_version 直接传入后端 API,严禁加任何前缀: + // 此处曾加 "pending-" 前缀,导致后端准备阶段报 Invalid SemVer: "pending-1.19"。 + // 教训:所有要传入 API 的 key 都不能加前缀(行类型区分请用 kind 字段)。 const pending: CurseforgeTableRow[] = publishVersions.map((v) => ({ - key: `pending-${v.key}`, + key: v.key, kind: "pending", pending: v, mc_version: v.mc_version,