完善伪静态链接

This commit is contained in:
2020-05-09 19:37:40 +08:00
parent 03fc965929
commit f1080e3618
66 changed files with 4490 additions and 4163 deletions
+28 -2
View File
@@ -23,7 +23,7 @@ namespace COMCMS.Web.Common
public static string EchoURL(ArticleCategory model)
{
if (model == null)
return "";
return "javascript:;";
if (!string.IsNullOrEmpty(model.FilePath))
return model.FilePath + "/index.html";
else
@@ -37,7 +37,7 @@ namespace COMCMS.Web.Common
public static string EchoURL(Category model)
{
if (model == null)
return "";
return "javascript:;";
if (!string.IsNullOrEmpty(model.FilePath))
return model.FilePath + "/index.html";
else
@@ -71,5 +71,31 @@ namespace COMCMS.Web.Common
}
#endregion
#region 生成详情地址
/// <summary>
/// 生成文章详情地址
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static string EchoArticleURL(Article model)
{
if (model == null)
return "javascript:;";
if (!string.IsNullOrEmpty(model.ArticleKind.FilePath))
{
string url = $"{model.ArticleKind.FilePath}/{model.Id}.html";
if (!string.IsNullOrEmpty(model.FileName))
{
url = $"{model.ArticleKind.FilePath}/{model.FileName}";
}
return url;
}
else
return $"/article/detail/{model.Id}";
}
#endregion
}
}