|
@@ -63,11 +63,14 @@ public class CommonServiceImpl implements ICommonService {
|
|
try {
|
|
try {
|
|
String uuid = UUID.randomUUID().toString();
|
|
String uuid = UUID.randomUUID().toString();
|
|
String originalFilename = file.getOriginalFilename();
|
|
String originalFilename = file.getOriginalFilename();
|
|
|
|
+
|
|
String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
|
|
String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
|
|
- String ossPath = String.format(OssPath.MANAGE_FILE_PATH, DateUtil.format(Calendar.getInstance()
|
|
|
|
- .getTime(), DateExtUtil.dateStyle6), uuid + extName);
|
|
|
|
|
|
+ String ossPath = String.format(OssPath.MANAGE_FILE_PATH, uuid + extName);
|
|
|
|
|
|
tempFile = new File(OssPath.localPath + ossPath);
|
|
tempFile = new File(OssPath.localPath + ossPath);
|
|
|
|
+ if(!tempFile.getParentFile().exists()){
|
|
|
|
+ tempFile.mkdirs();
|
|
|
|
+ }
|
|
file.transferTo(tempFile);
|
|
file.transferTo(tempFile);
|
|
fYunFileServiceInterface.uploadFile(tempFile.getPath(), ossPath);
|
|
fYunFileServiceInterface.uploadFile(tempFile.getPath(), ossPath);
|
|
String url = this.ossUrlPrefix + ossPath;
|
|
String url = this.ossUrlPrefix + ossPath;
|