修复显示地址问题。增加sitemap

This commit is contained in:
2020-05-13 15:35:25 +08:00
parent 2a49736cb8
commit a69621e016
7 changed files with 85 additions and 16 deletions
+33
View File
@@ -43,6 +43,39 @@ namespace COMCMS.Web.Common
else
return $"/product/index/{model.Id}";
}
/// <summary>
/// 生成文章详情地址
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static string EchoURL(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}";
}
/// <summary>
/// 商品
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static string EchoURL(Product model)
{
return $"/product/detail/{model.Id}";
}
/// <summary>
///
/// </summary>