diff --git a/admin-server/MiaoYu.Core.CodeGenerator/Core/PathResolver.cs b/admin-server/MiaoYu.Core.CodeGenerator/Core/PathResolver.cs index 3431a2f..2955233 100644 --- a/admin-server/MiaoYu.Core.CodeGenerator/Core/PathResolver.cs +++ b/admin-server/MiaoYu.Core.CodeGenerator/Core/PathResolver.cs @@ -30,13 +30,15 @@ public class PathResolver : IScopedDependency var rootPath = _environment.ContentRootPath .Replace("\\" + _environment.ApplicationName, ""); - + var webPath = Path.GetDirectoryName(Path.GetDirectoryName(_environment.ContentRootPath)) + .Replace("\\" + _environment.ApplicationName, ""); var entityName = GetEntityName(tableName, config); var entityNamePlural = config.UsesPluralPath ? entityName + "s" : entityName; var tableNameLower = string.IsNullOrWhiteSpace(tableName) ? string.Empty : tableName.ToLower(); return template .Replace("{RootPath}", rootPath) + .Replace("{WebPath}", webPath) .Replace("{AppPath}", _environment.ContentRootPath) .Replace("{Namespace}", config.EntityNamespace) .Replace("{EntityName}", entityName) diff --git a/admin-server/MiaoYu.Repository.LiveForum.Admin/Providers/LiveForumDataSourceProvider.cs b/admin-server/MiaoYu.Repository.LiveForum.Admin/Providers/LiveForumDataSourceProvider.cs index 0b1dd2a..7a70c82 100644 --- a/admin-server/MiaoYu.Repository.LiveForum.Admin/Providers/LiveForumDataSourceProvider.cs +++ b/admin-server/MiaoYu.Repository.LiveForum.Admin/Providers/LiveForumDataSourceProvider.cs @@ -21,9 +21,9 @@ public class LiveForumDataSourceProvider : IDataSourceProvider, IScopedDependenc ModelPathTemplate = "{RootPath}\\{Namespace}\\Entities\\Apps\\{EntityNamePlural}", ServicePathTemplate = "{AppPath}\\ApplicationServices\\Apps\\LiveForum\\{EntityNamePlural}", ControllerPathTemplate = "{AppPath}\\Controllers\\Apps\\LiveForum\\{EntityNamePlural}", - ClientIndexPathTemplate = "{RootPath}\\admin-client\\src\\views\\apps\\liveforum\\{TableNameLower}", - ClientInfoPathTemplate = "{RootPath}\\admin-client\\src\\views\\apps\\liveforum\\{TableNameLower}", - ClientServicePathTemplate = "{RootPath}\\admin-client\\src\\services\\apps\\liveforum\\{TableNameLower}", + ClientIndexPathTemplate = "{WebPath}\\admin-client\\src\\views\\apps\\liveforum\\{TableNameLower}", + ClientInfoPathTemplate = "{WebPath}\\admin-client\\src\\views\\apps\\liveforum\\{TableNameLower}", + ClientServicePathTemplate = "{WebPath}\\admin-client\\src\\services\\apps\\liveforum\\{TableNameLower}", MenuPathTemplate = "views/apps/liveforum/{TableNameLower}/Index.vue", RouterPathTemplate = "/apps/liveforum/{TableNameLower}", TemplatePath = "/wwwroot/code_generation/templatev5/",