fix(printer): 修复上传裁剪图片时的文件扩展名获取逻辑

- 将文件扩展名从resultImageUrl改为croppedFile.getName()中获取
- 确保上传裁剪后图片时能正确识别文件类型
- 避免因URL解析错误导致的文件扩展名丢失问题
This commit is contained in:
2025-11-21 11:47:05 +08:00
parent a860319ea1
commit 8791cf5910

View File

@@ -1269,7 +1269,7 @@ public class PrinterServiceImpl implements PrinterService {
try {
// 上传裁剪后的图片
String[] split = resultImageUrl.split("\\.");
String[] split = croppedFile.getName().split("\\.");
String ext = split.length > 0 ? split[split.length - 1] : "jpg";
cropUrl = StorageFactory.use().uploadFile(null, croppedFile, "printer", UUID.randomUUID() + "." + ext);