Browse Source

2025.06.16

java8
jiayang yue 7 months ago
parent
commit
acbe916ed8
  1. 4
      src/main/java/com/xujie/sys/modules/sys/service/impl/SysFileServiceImpl.java

4
src/main/java/com/xujie/sys/modules/sys/service/impl/SysFileServiceImpl.java

@ -68,12 +68,12 @@ public class SysFileServiceImpl implements SysFileService {
String newFileName = RandomUtil.getOrderNoByAtomic1("file") + suffix;
String basePath = filePath;
String baseDatePath = DateUtils.format(new Date());
File baseFilePath = new File(basePath + "/" + baseDatePath + "/" + inData.getFolder());
File baseFilePath = new File(basePath + "\\" + baseDatePath + "\\" + inData.getFolder());
if (!baseFilePath.exists()) {
baseFilePath.mkdirs();
}
// 最终的目录
String finalFileName = baseFilePath.getPath()+"/" + newFileName;
String finalFileName = baseFilePath.getPath()+"\\" + newFileName;
try {
baseFilePath = multipartFileToFile(file, finalFileName);
}catch (Exception e){

Loading…
Cancel
Save