fix - 文件分类

This commit is contained in:
2026-05-19 15:44:46 +08:00
parent 0907912773
commit 95e934c994
3 changed files with 5 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ public class OSSClientUtil {
boolean uploadResult = ossClient.doesObjectExist(bucketName, backUrl);
if (uploadResult) {
backUrl = getImgUrl(name);
backUrl = getImgUrl(path,name);
} else {
backUrl = "";
}
@@ -191,13 +191,12 @@ public class OSSClientUtil {
/**
* 获得图片路径
*
* @param fileUrl
* @return
*/
public String getImgUrl(String fileUrl) {
if (!StringUtils.isEmpty(fileUrl)) {
String[] split = fileUrl.split("/");
return url + this.imageDir + split[split.length - 1];
public String getImgUrl(String filePath,String filename) {
if (!StringUtils.isEmpty(filename)) {
String[] split = filename.split("/");
return url + filePath + split[split.length - 1];
}
return null;
}