From 0e1e76580878d0283d51be8f1701031a091c847e Mon Sep 17 00:00:00 2001 From: wayne Date: Wed, 11 Dec 2019 15:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=90=8E=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E6=8F=92=E4=BB=B6=E4=B8=AD=E7=9A=84=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E6=A8=A1=E6=9D=BF=20#349?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- src/EasyFrameWork/Mvc/RazorPages/ViewRenderService.cs | 10 +++++++++- src/ZKEACMS.Message/ZKEACMS.Message.csproj | 3 --- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5fea94200..671543f95 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/ZKEACMS.WebHost/bin/Debug/netcoreapp3.0/ZKEACMS.WebHost.dll", + "program": "${workspaceFolder}/src/ZKEACMS.WebHost/bin/Debug/netcoreapp3.1/ZKEACMS.WebHost.dll", "args": [], "cwd": "${workspaceFolder}/src/ZKEACMS.WebHost", "console": "internalConsole", diff --git a/src/EasyFrameWork/Mvc/RazorPages/ViewRenderService.cs b/src/EasyFrameWork/Mvc/RazorPages/ViewRenderService.cs index c42e2b2f4..3216dd843 100644 --- a/src/EasyFrameWork/Mvc/RazorPages/ViewRenderService.cs +++ b/src/EasyFrameWork/Mvc/RazorPages/ViewRenderService.cs @@ -46,7 +46,15 @@ public string Render(string viewPath, TModel model) { actualViewPath = actualViewPath.Replace(pluginPath, DeveloperViewFileProvider.ProjectRootPath); } - + else if (_hostingEnvironment.IsProduction() && actualViewPath.StartsWith(pluginPath)) + { + string filePath = actualViewPath.Replace("~/", string.Empty); + var fileInfo = _hostingEnvironment.ContentRootFileProvider.GetFileInfo(filePath); + if (!fileInfo.Exists) + { + actualViewPath = actualViewPath.Replace(pluginPath, "~/"); + } + } ViewEngineResult viewResult = _viewEngine.GetView(null, actualViewPath, true); if (!viewResult.Success) diff --git a/src/ZKEACMS.Message/ZKEACMS.Message.csproj b/src/ZKEACMS.Message/ZKEACMS.Message.csproj index cd08c6de0..847f960a6 100644 --- a/src/ZKEACMS.Message/ZKEACMS.Message.csproj +++ b/src/ZKEACMS.Message/ZKEACMS.Message.csproj @@ -19,7 +19,4 @@ - - -