@@ -222,7 +222,7 @@ namespace YhCore.Service.Impl
|
||||
|
||||
// 旧数据:相对路径如 /upload/docprint/20260101/{guid}.jpg(不含 FILE_PATH 前缀)→ StorageRoot + 子路径
|
||||
var relative = fileUrl.TrimStart('/');
|
||||
const string prefix = "upload/";
|
||||
string prefix = Config.FilePath;
|
||||
if (relative.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
|
||||
relative = relative.Substring(prefix.Length);
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace YhCore.Service.Impl
|
||||
return Config.FilePath;
|
||||
|
||||
// 此分支仅在 FILE_PATH 未配置时执行(此时 Config.FilePath 为 null,不可再参与拼接)
|
||||
return Path.Combine(AppContext.BaseDirectory, "upload");
|
||||
return Path.Combine(AppContext.BaseDirectory, Config.FilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user