From 73fb89a8f488af66eddb8943e4e257a3633f3edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 11 Sep 2026 18:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BB=E6=AD=A2=E6=9C=AC=E5=9C=B0=E7=B4=A0?= =?UTF-8?q?=E6=9D=90=E7=99=BB=E8=AE=B0=E7=BB=93=E6=9E=9C=E9=94=99=E4=BD=8D?= =?UTF-8?q?=E5=9B=9E=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 资源导入返回数量与请求路径不一致时立即中止位置映射。 --- .../src/view/ui-editor/useUiEditorPage.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts index 39726526d..850aa498b 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts +++ b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts @@ -1086,6 +1086,11 @@ export function useUiEditorSession( 'import_local_project_image_assets', { projectPath, relativePaths }, ); + if (imported.assets.length !== relativePaths.length) { + throw new Error( + `本地资源登记结果数量不匹配:请求 ${relativePaths.length} 个,返回 ${imported.assets.length} 个`, + ); + } for (const [assetIndex, asset] of imported.assets.entries()) { const normalizedAsset = { id: asset.id,