优化文件输入流可能为空的问题

pull/322/head
RuoYi 2 years ago
parent 5fcec99e6c
commit 74045776d6

@ -1,7 +1,6 @@
package com.ruoyi.file.service;
import java.io.InputStream;
import com.alibaba.nacos.common.utils.IoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

@ -4,6 +4,7 @@ import java.io.InputStream;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.nacos.common.utils.IoUtils;
import com.ruoyi.file.config.MinioConfig;
import com.ruoyi.file.utils.FileUploadUtils;
import io.minio.MinioClient;
@ -42,7 +43,7 @@ public class MinioSysFileServiceImpl implements ISysFileService
.contentType(file.getContentType())
.build();
client.putObject(args);
inputStream.close();
IoUtils.closeQuietly(inputStream);
return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
}
}

Loading…
Cancel
Save