24282 il y a 1 an
Parent
commit
42c555a582

+ 5 - 2
hx-file/src/main/java/com/fjhx/file/service/impl/FileInfoServiceImpl.java

@@ -53,11 +53,14 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
     @Value("${spring.profiles.active}")
     private String active;
 
+    @Value("${ruoyi.name}")
+    private String name;
+
     @Override
     public SingVo getSing(SingDto dto) {
 
         String fileName = dto.getFileName();
-        if (fileName.length()>100){
+        if (fileName.length() > 100) {
             throw new ServiceException("文件名过长,请缩短后重试!!!");
         }
 
@@ -68,7 +71,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
 
         // 文件路径
         String objectKey = new StringJoiner("/")
-                .add("byteSailing")
+                .add(name)
                 .add(active)
                 .add(DateUtil.format(new Date(), "yyyy/MM/dd"))
                 .add(IdUtil.fastSimpleUUID() + (ObjectUtil.isEmpty(suffix) ? "" : "." + suffix))