mirror of https://gitee.com/makejava/EasyCode.git
提高代码兼容性
This commit is contained in:
parent
0265363527
commit
712830c468
|
@ -286,12 +286,18 @@ public class VelocityUtils {
|
|||
cacheDataUtils.setSavePath(savePath);
|
||||
}
|
||||
String projectPath = cacheDataUtils.getProject().getBasePath();
|
||||
if (savePath.indexOf(projectPath) == 0) {
|
||||
savePath = savePath.substring(projectPath.length());
|
||||
if (savePath.startsWith("/")) {
|
||||
savePath = "." + savePath;
|
||||
} else {
|
||||
savePath = "./" + savePath;
|
||||
if (projectPath!=null) {
|
||||
// 兼容Linux路径
|
||||
if (projectPath.contains("\\")) {
|
||||
projectPath = projectPath.replace("\\", "/");
|
||||
}
|
||||
if (savePath.indexOf(projectPath) == 0) {
|
||||
savePath = savePath.substring(projectPath.length());
|
||||
if (savePath.startsWith("/")) {
|
||||
savePath = "." + savePath;
|
||||
} else {
|
||||
savePath = "./" + savePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue