fix: 已锁定文章禁止提交审核,隐藏提交按钮

- SubmitForAudit 新增 IsLocked 检查,锁定文章不可提交审核
- posts/show.html:已锁定文章不显示"提交审核"按钮
This commit is contained in:
2026-05-31 20:13:34 +08:00
parent 968e8af8a3
commit 0cfbb6911d
2 changed files with 4 additions and 1 deletions

View File

@ -251,6 +251,9 @@ func (s *PostService) SubmitForAudit(postID uint) error {
if err != nil {
return err
}
if post.IsLocked {
return common.ErrPostCannotEdit
}
if post.Status != model.PostStatusDraft && post.Status != model.PostStatusRejected {
return common.ErrPostCannotSubmit
}