From 363e0e11b36a57cda2ce0755d7d00a09bf503b8f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 Dec 2023 11:39:55 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Progranm.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 83d58d0b9..32c083754 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -295,6 +295,8 @@ try Log.Logger.Warning($"ContentRootPath——GetParent:{Path.GetDirectoryName(env.ContentRootPath)}"); + Log.Logger.Warning($"ContentRootPath——xx:{Path.GetFullPath(Path.GetDirectoryName(env.ContentRootPath))}"); + app.Run(); } From da155bfca345ed26323ad1c8c11c091faa797824 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 Dec 2023 12:22:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Progranm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 32c083754..9fab8adb1 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -295,7 +295,7 @@ try Log.Logger.Warning($"ContentRootPath——GetParent:{Path.GetDirectoryName(env.ContentRootPath)}"); - Log.Logger.Warning($"ContentRootPath——xx:{Path.GetFullPath(Path.GetDirectoryName(env.ContentRootPath))}"); + Log.Logger.Warning($"ContentRootPath——xx:{Path.GetDirectoryName(Path.GetDirectoryName(env.ContentRootPath))}"); app.Run(); From 46730347373b27ec8bedb6182d927a5509ff8b37 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 Dec 2023 12:39:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=B5=8B=E8=AF=95windows?= =?UTF-8?q?=20=20=E5=92=8Clinux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Progranm.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 9fab8adb1..7143b8724 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -293,9 +293,13 @@ try Log.Logger.Warning($"ContentRootPath:{env.ContentRootPath}"); - Log.Logger.Warning($"ContentRootPath——GetParent:{Path.GetDirectoryName(env.ContentRootPath)}"); + string parentDirectory = Path.GetFullPath(Path.Combine(env.ContentRootPath, "..")); - Log.Logger.Warning($"ContentRootPath——xx:{Path.GetDirectoryName(Path.GetDirectoryName(env.ContentRootPath))}"); + + Log.Logger.Warning($"ContentRootPath——parentDirectory:{parentDirectory}"); + + //Log.Logger.Warning($"ContentRootPath——GetParent:{Directory.GetParent(env.ContentRootPath).Parent.FullName}"); + //Log.Logger.Warning($"ContentRootPath——xx:{Path.GetDirectoryName(Path.GetDirectoryName(env.ContentRootPath))}"); app.Run(); From f4fc3dfab97aa830e350d3b7ef3ca124f1997ab4 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 Dec 2023 12:44:35 +0800 Subject: [PATCH 4/4] =?UTF-8?q?windows=20linux=20=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9=20=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/FileStoreHelper.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs index 63e2278f1..eae219e62 100644 --- a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs @@ -56,8 +56,9 @@ public static class FileStoreHelper //API vue 部署目录 public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment) { - var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName; - return rootPath; + string parentDirectory = Path.GetFullPath(Path.Combine(_hostEnvironment.ContentRootPath, "..")); + + return parentDirectory; }