问题 oss外链经过转编码后,部分无效,大概在三分一;无需转编码直接返回即可 #4023

https://github.com/jeecgboot/jeecg-boot/issues/4023
pull/4077/head
zhangdaiscott 2022-09-27 20:54:01 +08:00
parent ae74abe727
commit 28f007c13c
1 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,6 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Date;
import java.util.UUID;
@ -299,7 +298,10 @@ public class OssBootUtil {
//update-end---author:liusq Date:20220120 for替换objectName前缀防止key不一致导致获取不到文件----
if(ossClient.doesObjectExist(bucketName,objectName)){
URL url = ossClient.generatePresignedUrl(bucketName,objectName,expires);
return URLDecoder.decode(url.toString(),"UTF-8");
//log.info("原始url : {}", url.toString());
//log.info("decode url : {}", URLDecoder.decode(url.toString(), "UTF-8"));
//【issues/4023】问题 oss外链经过转编码后部分无效大概在三分一无需转编码直接返回即可 #4023
return url.toString();
}
}catch (Exception e){
log.info("文件路径获取失败" + e.getMessage());