|
@@ -190,6 +190,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
public SysOssVo upload(MultipartFile file) {
|
|
|
String originalfileName = file.getOriginalFilename();
|
|
|
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
|
|
|
+ suffix = suffix.toLowerCase();
|
|
|
OssClient storage = OssFactory.instance();
|
|
|
UploadResult uploadResult;
|
|
|
try {
|
|
@@ -199,7 +200,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
}
|
|
|
|
|
|
// 保存文件信息
|
|
|
- return buildResultEntity(originalfileName, suffix,file.getSize(), storage.getConfigKey(), uploadResult);
|
|
|
+ return buildResultEntity(originalfileName.replaceAll("PDF","pdf"), suffix,file.getSize(), storage.getConfigKey(), uploadResult);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -265,4 +266,20 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
private SysOssFilesVo matchingFileUrl(SysOssFilesVo oss) {
|
|
|
return (SysOssFilesVo)this.matchingUrl(oss);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// private String gettoken(String url) {
|
|
|
+//// OssClient storage = OssFactory.instance(oss.getService());
|
|
|
+////
|
|
|
+//// storage.getConfigKey()
|
|
|
+//// String accessKey = "access key";
|
|
|
+//// String secretKey = "secret key";
|
|
|
+//// String bucket = "bucket name";
|
|
|
+////
|
|
|
+//// Auth auth = Auth.create(accessKey, secretKey);
|
|
|
+//// String upToken = auth.uploadToken(bucket);
|
|
|
+//// System.out.println(upToken);
|
|
|
+//
|
|
|
+// }
|
|
|
}
|
|
|
+
|