mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-06-08 01:48:21 +08:00
导出时,如果配置的magic-api.resource.prefix为/,则导出的内容无法导入
This commit is contained in:
@@ -146,7 +146,7 @@ public class FileResource implements Resource {
|
||||
parent = parent.parent();
|
||||
}
|
||||
String path = this.getAbsolutePath()
|
||||
.replace(parent.getAbsolutePath(), "")
|
||||
.substring(parent.getAbsolutePath().length())
|
||||
.replace("\\", "/");
|
||||
if (isDirectory() && !path.endsWith("/")) {
|
||||
path += "/";
|
||||
|
||||
@@ -175,7 +175,7 @@ public abstract class KeyValueResource implements Resource {
|
||||
parent = parent.parent();
|
||||
}
|
||||
String path = this.getAbsolutePath()
|
||||
.replace(parent.getAbsolutePath(), "")
|
||||
.substring(parent.getAbsolutePath().length())
|
||||
.replace("\\", "/")
|
||||
.replace(this.separator, "/");
|
||||
return path.startsWith("/") ? path.substring(1) : path;
|
||||
|
||||
Reference in New Issue
Block a user