增加文章栏目伪静态规则1

This commit is contained in:
comm5v8
2019-05-25 17:26:40 +08:00
parent 34fdb431d4
commit 993de032b9
9 changed files with 206 additions and 34 deletions
+5 -7
View File
@@ -19,6 +19,7 @@ namespace COMCMS.Web.Controllers
public IActionResult Index(int id = 0, int page = 1)
{
ArticleCategory model = ArticleCategory.FindById(id);
if (model == null)
{
return AlertAndGoBack("系统找不到本记录");
@@ -88,16 +89,13 @@ namespace COMCMS.Web.Controllers
}
ViewBag.cfg = cfg;
string templatesname = "";//模板名称
string templatesname = "Index.cshtml";//模板名称
if (!string.IsNullOrEmpty(model.TemplateFile))
{
templatesname = model.TemplateFile.Replace(".cshtml", "").Replace(".aspx", "");
return View(templatesname, model);
}
else
{
return View(model);
templatesname = model.TemplateFile;
//return Content(templatesname);
}
return View("~/Views/Article/" + templatesname, model); //固定死就是这个
}
#endregion