|
@@ -2,6 +2,7 @@ package com.citu.module.menduner.system.controller.app.common.file;
|
|
|
|
|
|
import cn.hutool.core.io.IoUtil;
|
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
|
+import com.citu.framework.common.util.io.FileUtils;
|
|
|
import com.citu.framework.security.core.annotations.PreAuthenticated;
|
|
|
import com.citu.module.infra.api.file.FileApi;
|
|
|
import com.citu.module.menduner.common.util.LoginUserContext;
|
|
@@ -45,10 +46,11 @@ public class AppFileController {
|
|
|
MultipartFile file = reqVO.getFile();
|
|
|
String path = reqVO.getPath();
|
|
|
if (StringUtils.hasText(path)) {
|
|
|
+ String name = FileUtils.generatePath(IoUtil.readBytes(file.getInputStream()), file.getOriginalFilename());
|
|
|
if (path.endsWith("/")) {
|
|
|
- path += file.getOriginalFilename();
|
|
|
+ path += name;
|
|
|
} else {
|
|
|
- path += "/" + file.getOriginalFilename();
|
|
|
+ path += "/" + name;
|
|
|
}
|
|
|
}
|
|
|
|