|
@@ -45,8 +45,9 @@ public class BaseService {
|
45
|
45
|
public MessageBean<String> uploadModelCompress(MultipartFile file, String path) {
|
46
|
46
|
String fileName = file.getOriginalFilename();
|
47
|
47
|
String suffix = fileName == null ? "" : fileName.substring(fileName.lastIndexOf(".") + 1);
|
48
|
|
- if (!suffix.equals("zip"))
|
|
48
|
+ if (!suffix.equals("zip") || !suffix.equals("rar")) {
|
49
|
49
|
return MessageBean.error("上传文件类型必须是zip、rar格式的模型文件");
|
|
50
|
+ }
|
50
|
51
|
String newFileName = UUID.randomUUID() + "." + suffix;
|
51
|
52
|
String filePath = "./upload/" + path;
|
52
|
53
|
FileUtils.saveFile(file, filePath, newFileName);
|