修复返回path不是相对prefix的

This commit is contained in:
2024-12-29 18:06:30 +08:00
parent 5af3a14f03
commit 888698de73
3 changed files with 16 additions and 2 deletions

View File

@@ -38,4 +38,14 @@ public class StorageUtil {
}
return name;
}
public static String getRelativePath(String fullPath, String relativeOn) {
if (StringUtils.isBlank(relativeOn)) {
fullPath = fullPath.replace(relativeOn, "");
}
if (fullPath.startsWith("/")) {
fullPath = fullPath.substring(1);
}
return fullPath;
}
}