Skip to content

Commit

Permalink
fix: 修复未初始化标签时初始化异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 11, 2023
1 parent 9742bf5 commit cea4056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/composables/usePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ const usePublish = () => {
mergedPost.mt_excerpt = mergedPost.shortDesc
}

const postKeywords = post.mt_keywords.split(",")
const newPostKeywords = newPost.mt_keywords.split(",")
const postKeywords = post?.mt_keywords?.split(",") ?? []
const newPostKeywords = newPost?.mt_keywords?.split(",") ?? []
// 合并并去重关键词
const mergedKeywords = [...new Set([...postKeywords, ...newPostKeywords])].filter((tag) => tag.trim() !== "")
mergedPost.mt_keywords = mergedKeywords.join(",")
Expand Down

0 comments on commit cea4056

Please sign in to comment.