|
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Base64;
|
|
import java.util.Base64;
|
|
@@ -73,7 +74,6 @@ public class SpaceSdkServiceImpl extends ServiceImpl<ISpaceSdkMapper, SpaceSdk>
|
|
fileNameAll = file.getOriginalFilename();
|
|
fileNameAll = file.getOriginalFilename();
|
|
|
|
|
|
// 将文件转字节-> 字符串
|
|
// 将文件转字节-> 字符串
|
|
- String fileContent = Base64.getEncoder().encodeToString(file.getBytes());
|
|
|
|
|
|
|
|
// 获取类路径
|
|
// 获取类路径
|
|
String resourcePath = FileUtils.getResource();
|
|
String resourcePath = FileUtils.getResource();
|
|
@@ -90,7 +90,8 @@ public class SpaceSdkServiceImpl extends ServiceImpl<ISpaceSdkMapper, SpaceSdk>
|
|
String filePath = dirPath + DateUtil.dateStr() + fileNameAll;
|
|
String filePath = dirPath + DateUtil.dateStr() + fileNameAll;
|
|
|
|
|
|
// 写文件到本地
|
|
// 写文件到本地
|
|
- FileUtils.base64ToFileWriter(fileContent, filePath);
|
|
|
|
|
|
+ File file1 = new File(filePath);
|
|
|
|
+ file.transferTo(file1);
|
|
log.info("filePath: {}", filePath);
|
|
log.info("filePath: {}", filePath);
|
|
|
|
|
|
// 上传到阿里云sso
|
|
// 上传到阿里云sso
|