Config.FilePath
build / build-push (push) Successful in 1m24s

This commit is contained in:
wanghu
2026-09-09 16:04:46 +08:00
parent e9e1c1722d
commit 4211b72041
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -71,7 +71,7 @@ namespace YhCore.Service.Impl
if (appType.ToLower() == "noticemsg") appType = "notice"; if (appType.ToLower() == "noticemsg") appType = "notice";
string dtStr = DateTime.Now.ToString("yyyyMMdd"); string dtStr = DateTime.Now.ToString("yyyyMMdd");
string physicalDir = Path.Combine(StorageRoot(), appType, dtStr); string physicalDir = Path.Combine(StorageRoot(), appType, dtStr);
string outFilePath = "/upload/" + appType + "/" + dtStr + "/"; string outFilePath = Config.FilePath + appType + "/" + dtStr + "/";
if (!Directory.Exists(physicalDir)) if (!Directory.Exists(physicalDir))
Directory.CreateDirectory(physicalDir); Directory.CreateDirectory(physicalDir);
@@ -109,7 +109,7 @@ namespace YhCore.Service.Impl
if (appType.ToLower() == "noticemsg") appType = "notice"; if (appType.ToLower() == "noticemsg") appType = "notice";
string dtStr = DateTime.Now.ToString("yyyyMMdd"); string dtStr = DateTime.Now.ToString("yyyyMMdd");
string physicalDir = Path.Combine(StorageRoot(), appType, dtStr); string physicalDir = Path.Combine(StorageRoot(), appType, dtStr);
string outFilePath = "/upload/" + appType + "/" + dtStr + "/"; string outFilePath = Config.FilePath + appType + "/" + dtStr + "/";
if (!Directory.Exists(physicalDir)) if (!Directory.Exists(physicalDir))
Directory.CreateDirectory(physicalDir); Directory.CreateDirectory(physicalDir);
@@ -169,7 +169,7 @@ namespace YhCore.Service.Impl
if (appType.ToLower() == "noticemsg") appType = "notice"; if (appType.ToLower() == "noticemsg") appType = "notice";
string dtStr = DateTime.Now.ToString("yyyyMMdd"); string dtStr = DateTime.Now.ToString("yyyyMMdd");
string physicalDir = Path.Combine(StorageRoot(), appType, dtStr); string physicalDir = Path.Combine(StorageRoot(), appType, dtStr);
string outFilePath = "/upload/" + appType + "/" + dtStr + "/"; string outFilePath = Config.FilePath+ appType + "/" + dtStr + "/";
if (!Directory.Exists(physicalDir)) if (!Directory.Exists(physicalDir))
Directory.CreateDirectory(physicalDir); Directory.CreateDirectory(physicalDir);
@@ -216,7 +216,7 @@ namespace YhCore.Service.Impl
// 相对路径如 /upload/docprint/20260101/{guid}.jpg → Config.FilePath + 子路径 // 相对路径如 /upload/docprint/20260101/{guid}.jpg → Config.FilePath + 子路径
var relative = fileUrl.TrimStart('/'); var relative = fileUrl.TrimStart('/');
const string prefix = "upload/"; string prefix = Config.FilePath;
if (relative.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) if (relative.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
relative = relative.Substring(prefix.Length); relative = relative.Substring(prefix.Length);
@@ -229,7 +229,7 @@ namespace YhCore.Service.Impl
if (!string.IsNullOrEmpty(Config.FilePath)) if (!string.IsNullOrEmpty(Config.FilePath))
return Config.FilePath; return Config.FilePath;
return Path.Combine(AppContext.BaseDirectory, "upload"); return Path.Combine(AppContext.BaseDirectory,Config.FilePath);
} }
} }
} }
+1 -1
View File
@@ -10,7 +10,7 @@
"Redis": { "Redis": {
"ConnectionString": "localhost:6379,defaultDatabase=0" "ConnectionString": "localhost:6379,defaultDatabase=0"
}, },
"FILE_PATH": "upload", "FILE_PATH": "",
"FILE_WEB_PATH": "", "FILE_WEB_PATH": "",
"wkhtmltopdf_path": "", "wkhtmltopdf_path": "",
"yh": { "yh": {