From bb2f080d3bf6f1cadc20211a6ecc8428bbdc9a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 12 Sep 2026 16:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=A6=BB=E4=BA=A7=E7=89=A9=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20UUID=20=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 切分图片文件名改用 UUID,避免把 NodeId 当作物理路径。 继续通过 cut_paths 写入 BoundNode.cut_image_path,保留逻辑节点 ID 与产物路径的独立性。 --- .../src/ui_editor/commands/separation/workflow/mod.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs index 181964feb..ffa1092da 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs @@ -20,6 +20,7 @@ use std::collections::HashMap; use std::fs; use std::path::Path; use std::time::Instant; +use uuid::Uuid; pub(crate) async fn separate_ui_impl( project_path: String, @@ -205,13 +206,7 @@ pub(crate) async fn separate_ui_impl( } = decision { let node_id = to_node.as_str(); - if !node_id.chars().all(|character| { - character.is_ascii_alphanumeric() || matches!(character, '-' | '_') - }) { - cut_error = Some(format!("节点 {} 的名称包含非法路径字符", node_id)); - break; - } - let cut_path = sidecar.join(format!("cut-{node_id}.png")); + let cut_path = sidecar.join(format!("cut-{}.png", Uuid::new_v4())); if !cut_path.starts_with(&sidecar) { cut_error = Some(format!("节点 {} 的路径越界", node_id)); break;