@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user