diff --git a/MFCCreoDll.cpp b/MFCCreoDll.cpp index 4e22697..2fd45db 100644 --- a/MFCCreoDll.cpp +++ b/MFCCreoDll.cpp @@ -1374,6 +1374,47 @@ HttpResponse CloseModelHandler(const HttpRequest& request) { return response; } +// 辅助函数:去除 Creo 文件路径末尾的版本号后缀 +// 例如: D:\path\file.prt.1 -> D:\path\file.prt +// D:\path\file.asm.123 -> D:\path\file.asm +std::string StripCreoVersionSuffix(const std::string& file_path) { + // 查找最后一个路径分隔符 + size_t last_sep = file_path.find_last_of("/\\"); + std::string dir_part = (last_sep != std::string::npos) ? file_path.substr(0, last_sep + 1) : ""; + std::string file_name = (last_sep != std::string::npos) ? file_path.substr(last_sep + 1) : file_path; + + // 检查文件名是否以 .数字 结尾 (Creo 版本号格式) + size_t last_dot = file_name.rfind('.'); + if (last_dot != std::string::npos && last_dot < file_name.length() - 1) { + std::string suffix = file_name.substr(last_dot + 1); + // 检查后缀是否全为数字 + bool all_digits = !suffix.empty(); + for (char c : suffix) { + if (!isdigit(static_cast(c))) { + all_digits = false; + break; + } + } + + if (all_digits) { + // 去除版本号后缀 + std::string stripped_name = file_name.substr(0, last_dot); + // 确保去掉版本号后仍然有 Creo 扩展名 (.prt, .asm 等) + size_t ext_dot = stripped_name.rfind('.'); + if (ext_dot != std::string::npos) { + std::string ext = stripped_name.substr(ext_dot + 1); + // 验证是 Creo 扩展名 + if (ext == "prt" || ext == "asm" || ext == "drw" || ext == "frm" || ext == "lay" || ext == "sec") { + return dir_part + stripped_name; + } + } + } + } + + // 不匹配 Creo 版本号格式,返回原路径 + return file_path; +} + // 打开模型路由处理器 HttpResponse OpenModelHandler(const HttpRequest& request) { HttpResponse response; @@ -1410,6 +1451,9 @@ HttpResponse OpenModelHandler(const HttpRequest& request) { file_path = dirname + "/" + filename; } + // 去除 Creo 文件版本号后缀 (如 .prt.1 -> .prt) + file_path = StripCreoVersionSuffix(file_path); + if (software_type != "creo") { response.status_code = 400; response.body = "{\"success\": false, \"error\": \"Invalid software_type, must be 'creo'\"}"; diff --git a/MFCCreoDll/x64/Debug/AuthManager.obj b/MFCCreoDll/x64/Debug/AuthManager.obj index 02398f3..cb24c56 100644 Binary files a/MFCCreoDll/x64/Debug/AuthManager.obj and b/MFCCreoDll/x64/Debug/AuthManager.obj differ diff --git a/MFCCreoDll/x64/Debug/BatchOperationManager.obj b/MFCCreoDll/x64/Debug/BatchOperationManager.obj index f5ae760..52609de 100644 Binary files a/MFCCreoDll/x64/Debug/BatchOperationManager.obj and b/MFCCreoDll/x64/Debug/BatchOperationManager.obj differ diff --git a/MFCCreoDll/x64/Debug/ComponentChildrenManager.obj b/MFCCreoDll/x64/Debug/ComponentChildrenManager.obj index e7fb119..8e21fa7 100644 Binary files a/MFCCreoDll/x64/Debug/ComponentChildrenManager.obj and b/MFCCreoDll/x64/Debug/ComponentChildrenManager.obj differ diff --git a/MFCCreoDll/x64/Debug/CreoManager.obj b/MFCCreoDll/x64/Debug/CreoManager.obj index a94a251..44df3d0 100644 Binary files a/MFCCreoDll/x64/Debug/CreoManager.obj and b/MFCCreoDll/x64/Debug/CreoManager.obj differ diff --git a/MFCCreoDll/x64/Debug/CreoUtilities.obj b/MFCCreoDll/x64/Debug/CreoUtilities.obj index 06d3247..482f25f 100644 Binary files a/MFCCreoDll/x64/Debug/CreoUtilities.obj and b/MFCCreoDll/x64/Debug/CreoUtilities.obj differ diff --git a/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj b/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj index 1e9dcfb..235a8e4 100644 Binary files a/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj and b/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj differ diff --git a/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj b/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj index a20ca49..02f0120 100644 Binary files a/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj and b/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj differ diff --git a/MFCCreoDll/x64/Debug/HttpRouter.obj b/MFCCreoDll/x64/Debug/HttpRouter.obj index 4ad564c..750d2ec 100644 Binary files a/MFCCreoDll/x64/Debug/HttpRouter.obj and b/MFCCreoDll/x64/Debug/HttpRouter.obj differ diff --git a/MFCCreoDll/x64/Debug/HttpServer.obj b/MFCCreoDll/x64/Debug/HttpServer.obj index fe66407..13ac96a 100644 Binary files a/MFCCreoDll/x64/Debug/HttpServer.obj and b/MFCCreoDll/x64/Debug/HttpServer.obj differ diff --git a/MFCCreoDll/x64/Debug/JsonHelper.obj b/MFCCreoDll/x64/Debug/JsonHelper.obj index 6867ba6..1d59c32 100644 Binary files a/MFCCreoDll/x64/Debug/JsonHelper.obj and b/MFCCreoDll/x64/Debug/JsonHelper.obj differ diff --git a/MFCCreoDll/x64/Debug/Logger.obj b/MFCCreoDll/x64/Debug/Logger.obj index 0f69eae..a3d8ab8 100644 Binary files a/MFCCreoDll/x64/Debug/Logger.obj and b/MFCCreoDll/x64/Debug/Logger.obj differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.obj b/MFCCreoDll/x64/Debug/MFCCreoDll.obj index 6d08ee9..fc73754 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.obj and b/MFCCreoDll/x64/Debug/MFCCreoDll.obj differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.pch b/MFCCreoDll/x64/Debug/MFCCreoDll.pch index 67ff308..c669afd 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.pch and b/MFCCreoDll/x64/Debug/MFCCreoDll.pch differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.res b/MFCCreoDll/x64/Debug/MFCCreoDll.res new file mode 100644 index 0000000..a50c379 Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.res differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.command.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.command.1.tlog index db21317..4a3fe9a 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.command.1.tlog and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.command.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.read.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.read.1.tlog index 2a03ba0..27d7215 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.read.1.tlog and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.read.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.write.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.write.1.tlog index 9cf6015..f379b1d 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.write.1.tlog and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/CL.write.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/Cl.items.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/Cl.items.tlog new file mode 100644 index 0000000..7d31057 --- /dev/null +++ b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/Cl.items.tlog @@ -0,0 +1,21 @@ +C:\Users\sladr\source\repos\MFCCreoDll\AuthManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\AuthManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\BatchOperationManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\BatchOperationManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\ComponentChildrenManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ComponentChildrenManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\CreoManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\CreoManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\CreoUtilities.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\CreoUtilities.obj +C:\Users\sladr\source\repos\MFCCreoDll\GeometryAnalyzer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\GeometryAnalyzer.obj +C:\Users\sladr\source\repos\MFCCreoDll\HierarchyStatisticsAnalyzer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\HierarchyStatisticsAnalyzer.obj +C:\Users\sladr\source\repos\MFCCreoDll\HttpRouter.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\HttpRouter.obj +C:\Users\sladr\source\repos\MFCCreoDll\HttpServer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\HttpServer.obj +C:\Users\sladr\source\repos\MFCCreoDll\JsonHelper.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\JsonHelper.obj +C:\Users\sladr\source\repos\MFCCreoDll\Logger.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\Logger.obj +C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\MFCCreoDll.obj +C:\Users\sladr\source\repos\MFCCreoDll\ModelAnalyzer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ModelAnalyzer.obj +C:\Users\sladr\source\repos\MFCCreoDll\ModelSearchEngine.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ModelSearchEngine.obj +C:\Users\sladr\source\repos\MFCCreoDll\ModelSearchHandler.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ModelSearchHandler.obj +C:\Users\sladr\source\repos\MFCCreoDll\PathDeleteManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\PathDeleteManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\pch.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\pch.obj +C:\Users\sladr\source\repos\MFCCreoDll\ServerManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ServerManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\ShellExportHandler.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ShellExportHandler.obj +C:\Users\sladr\source\repos\MFCCreoDll\ShrinkwrapManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ShrinkwrapManager.obj +C:\Users\sladr\source\repos\MFCCreoDll\WebSocketServer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\WebSocketServer.obj diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.command.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.command.1.tlog new file mode 100644 index 0000000..e215855 Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.command.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.read.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.read.1.tlog new file mode 100644 index 0000000..a22fea1 Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.read.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.secondary.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.secondary.1.tlog new file mode 100644 index 0000000..8fbb92a --- /dev/null +++ b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.secondary.1.tlog @@ -0,0 +1,3 @@ +^C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\AUTHMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\BATCHOPERATIONMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\COMPONENTCHILDRENMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\CREOMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\CREOUTILITIES.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\GEOMETRYANALYZER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\HIERARCHYSTATISTICSANALYZER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\HTTPROUTER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\HTTPSERVER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\JSONHELPER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\LOGGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MFCCREODLL.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MFCCREODLL.RES|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MODELANALYZER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MODELSEARCHENGINE.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MODELSEARCHHANDLER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\PATHDELETEMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\PCH.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\SERVERMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\SHELLEXPORTHANDLER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\SHRINKWRAPMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\WEBSOCKETSERVER.OBJ +C:\Users\sladr\source\repos\MFCCreoDll\x64\Debug\MFCCreoDll.lib +C:\Users\sladr\source\repos\MFCCreoDll\x64\Debug\MFCCreoDll.EXP diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.write.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.write.1.tlog new file mode 100644 index 0000000..e08e24f Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/link.write.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.command.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.command.1.tlog new file mode 100644 index 0000000..bb78384 Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.command.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.read.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.read.1.tlog new file mode 100644 index 0000000..51d68a6 Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.read.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.write.1.tlog b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.write.1.tlog new file mode 100644 index 0000000..6cec13a Binary files /dev/null and b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/rc.write.1.tlog differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/unsuccessfulbuild b/MFCCreoDll/x64/Debug/MFCCreoDll.tlog/unsuccessfulbuild deleted file mode 100644 index e69de29..0000000 diff --git a/MFCCreoDll/x64/Debug/ModelAnalyzer.obj b/MFCCreoDll/x64/Debug/ModelAnalyzer.obj index 2aea724..9696a77 100644 Binary files a/MFCCreoDll/x64/Debug/ModelAnalyzer.obj and b/MFCCreoDll/x64/Debug/ModelAnalyzer.obj differ diff --git a/MFCCreoDll/x64/Debug/ModelSearchEngine.obj b/MFCCreoDll/x64/Debug/ModelSearchEngine.obj index 43068c3..cfa8920 100644 Binary files a/MFCCreoDll/x64/Debug/ModelSearchEngine.obj and b/MFCCreoDll/x64/Debug/ModelSearchEngine.obj differ diff --git a/MFCCreoDll/x64/Debug/ModelSearchHandler.obj b/MFCCreoDll/x64/Debug/ModelSearchHandler.obj index f7d8aea..01c471a 100644 Binary files a/MFCCreoDll/x64/Debug/ModelSearchHandler.obj and b/MFCCreoDll/x64/Debug/ModelSearchHandler.obj differ diff --git a/MFCCreoDll/x64/Debug/PathDeleteManager.obj b/MFCCreoDll/x64/Debug/PathDeleteManager.obj index 53bcf99..791bb73 100644 Binary files a/MFCCreoDll/x64/Debug/PathDeleteManager.obj and b/MFCCreoDll/x64/Debug/PathDeleteManager.obj differ diff --git a/MFCCreoDll/x64/Debug/ServerManager.obj b/MFCCreoDll/x64/Debug/ServerManager.obj index d5cc33d..6930c6a 100644 Binary files a/MFCCreoDll/x64/Debug/ServerManager.obj and b/MFCCreoDll/x64/Debug/ServerManager.obj differ diff --git a/MFCCreoDll/x64/Debug/ShellExportHandler.obj b/MFCCreoDll/x64/Debug/ShellExportHandler.obj index bc03bd4..fa8aed3 100644 Binary files a/MFCCreoDll/x64/Debug/ShellExportHandler.obj and b/MFCCreoDll/x64/Debug/ShellExportHandler.obj differ diff --git a/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj b/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj new file mode 100644 index 0000000..ad471dd Binary files /dev/null and b/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj differ diff --git a/MFCCreoDll/x64/Debug/WebSocketServer.obj b/MFCCreoDll/x64/Debug/WebSocketServer.obj index 7506435..4558ed3 100644 Binary files a/MFCCreoDll/x64/Debug/WebSocketServer.obj and b/MFCCreoDll/x64/Debug/WebSocketServer.obj differ diff --git a/MFCCreoDll/x64/Debug/pch.obj b/MFCCreoDll/x64/Debug/pch.obj index acf0054..4d230a0 100644 Binary files a/MFCCreoDll/x64/Debug/pch.obj and b/MFCCreoDll/x64/Debug/pch.obj differ diff --git a/MFCCreoDll/x64/Debug/vc143.pdb b/MFCCreoDll/x64/Debug/vc143.pdb index ed76937..1f7cac4 100644 Binary files a/MFCCreoDll/x64/Debug/vc143.pdb and b/MFCCreoDll/x64/Debug/vc143.pdb differ diff --git a/x64/Debug/MFCCreoDll.dll b/x64/Debug/MFCCreoDll.dll new file mode 100644 index 0000000..74356f4 Binary files /dev/null and b/x64/Debug/MFCCreoDll.dll differ diff --git a/x64/Debug/MFCCreoDll.exp b/x64/Debug/MFCCreoDll.exp new file mode 100644 index 0000000..414de9c Binary files /dev/null and b/x64/Debug/MFCCreoDll.exp differ diff --git a/x64/Debug/MFCCreoDll.lib b/x64/Debug/MFCCreoDll.lib new file mode 100644 index 0000000..b942643 Binary files /dev/null and b/x64/Debug/MFCCreoDll.lib differ diff --git a/x64/Debug/MFCCreoDll.pdb b/x64/Debug/MFCCreoDll.pdb new file mode 100644 index 0000000..ed2634b Binary files /dev/null and b/x64/Debug/MFCCreoDll.pdb differ