fix(文档拆分): 图片上传问题修复
This commit is contained in:
@@ -11,12 +11,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.ProtocolException;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -94,7 +92,7 @@ public class MinioUtil {
|
||||
orgName=file.getName();
|
||||
}
|
||||
orgName = CommonUtils.getFileName(orgName);
|
||||
String objectName = bizPath+File.separator
|
||||
String objectName = bizPath+"/"
|
||||
+(!orgName.contains(".")
|
||||
?orgName + "_" + System.currentTimeMillis()
|
||||
:orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."))
|
||||
|
||||
+4
-6
@@ -19,9 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -169,22 +167,22 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 将文件上传至腾讯云 cos
|
||||
MinioUtil.upload(mf, filePath);
|
||||
String upload = MinioUtil.upload(mf, "/" + uploadCospath);
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//存入文件表
|
||||
oSSFile.setFileName(orgName);
|
||||
oSSFile.setId(UuidUtils.getUUID());
|
||||
oSSFile.setUrl(filePath);
|
||||
oSSFile.setCreateBy(loginUser.getUsername());
|
||||
oSSFile.setCreateTime(new Date());
|
||||
this.save(oSSFile);
|
||||
// 文件路径做特殊处理
|
||||
// BASE64Encoder base64Encoder = new BASE64Encoder();
|
||||
// String encode = base64Encoder.encode(filePath.getBytes(StandardCharsets.UTF_8));
|
||||
String imgUrl = splitUrl + filePath;
|
||||
oSSFile.setUrl(imgUrl);
|
||||
String imgUrl = upload.split("/")[1];
|
||||
oSSFile.setUrl(splitUrl + imgUrl);
|
||||
return oSSFile;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -808,7 +808,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
@Override
|
||||
public void revocation(Map<String, Object> parameter) {
|
||||
String id = (String) parameter.get(ID);
|
||||
// 文档拆分信息(旧)
|
||||
// 文档拆分信息
|
||||
DocumentSplitInfo oldInfo = documentSplitMapper.queryDocumentSplitInfoById(id);
|
||||
// 修改发布状态
|
||||
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
Reference in New Issue
Block a user