You've already forked FrameTour-BE
fix(printer): 修复上传裁剪图片时的文件扩展名获取逻辑
- 将文件扩展名从resultImageUrl改为croppedFile.getName()中获取 - 确保上传裁剪后图片时能正确识别文件类型 - 避免因URL解析错误导致的文件扩展名丢失问题
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user