|
|
@@ -106,12 +106,15 @@ public class ServiceFileUtil {
|
|
|
logger.warn("目录不存在: {}", directoryPath);
|
|
|
throw new ServiceException("目录不存在: " + directoryPath);
|
|
|
}
|
|
|
- //这里拼接文件名
|
|
|
+
|
|
|
+ //这里拼接文件名,把前缀去掉
|
|
|
+ String tmpFileName = file.getFileName().toString().replaceAll("^[0-9]+[_]{1}","");
|
|
|
if (directoryPath.endsWith("/")) {
|
|
|
- directoryPath += file.getFileName();
|
|
|
+ directoryPath += tmpFileName;
|
|
|
} else {
|
|
|
- directoryPath += "/" + file.getFileName();
|
|
|
+ directoryPath += "/" + tmpFileName;
|
|
|
}
|
|
|
+
|
|
|
dirPath = Paths.get(directoryPath);
|
|
|
try {
|
|
|
//Files.copy(file, dirPath, StandardCopyOption.REPLACE_EXISTING);
|