Skip to content

Commit

Permalink
文章发布日期变更为可编辑 #491
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriaWei committed Jun 27, 2023
1 parent 99a2c77 commit c06461f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/ZKEACMS.Article/Service/ArticleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ public void Publish(int ID)
public void Publish(ArticleEntity article)
{
article.IsPublish = true;
article.PublishDate = DateTime.Now;
if (article.PublishDate == null)
{
article.PublishDate = DateTime.Now;
}
if (article.ID > 0)
{
Update(article);
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS/Article/Models/ArticleEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected override void ViewConfigure()
.ShowInGrid();

ViewConfig(m => m.ArticleContent).AsTextArea().AddClass(StringKeys.HtmlEditorClass);
ViewConfig(m => m.PublishDate).AsTextBox().Hide();
ViewConfig(m => m.PublishDate).AsTextBox().FormatAsDate();
ViewConfig(m => m.IsPublish).AsTextBox().Hide().ShowInGrid();
}
}
Expand Down

0 comments on commit c06461f

Please sign in to comment.