|
@@ -88,7 +88,7 @@ public class UploadService {
|
|
|
if(newName){
|
|
|
fileName = UUID.randomUUID().toString().replace("-","") ;
|
|
|
}else {
|
|
|
- fileName= URLEncoder.encode(fileName.substring(0,fileName.lastIndexOf(".")),"utf-8");
|
|
|
+ fileName= fileName.substring(0,fileName.lastIndexOf("."));
|
|
|
}
|
|
|
if(fileName.length() >50){
|
|
|
fileName = fileName.substring(0,50);
|
|
@@ -100,7 +100,7 @@ public class UploadService {
|
|
|
if(!uploadToOssUtil.existKey(filePathAdd + fileName + suffixName)){
|
|
|
throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
|
|
|
}
|
|
|
- return queryPath +filePathAdd+ fileName + suffixName;
|
|
|
+ return queryPath +filePathAdd+ URLEncoder.encode(fileName,"utf-8") + suffixName;
|
|
|
}catch (Exception e){
|
|
|
log.info("upload-error:{}",e);
|
|
|
throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
|