Skip to content

Commit

Permalink
fix: 修复多个平台发布之后数据不一致的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 31, 2023
1 parent 0e1e7f1 commit fd9cfe7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/composables/usePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,18 @@ const usePublish = () => {
},

// 分配平台相关的初始化属性
assignInitAttrs: async (post: Post, id: string, publishCfg: IPublishCfg) => {
assignInitAttrs: async (doc: Post, id: string, publishCfg: IPublishCfg) => {
const setting: typeof SypConfig = publishCfg.setting
const cfg: BlogConfig = publishCfg.cfg
const dynCfg: DynamicConfig = publishCfg.dynCfg
const key = dynCfg.platformKey
const isSys = pre.systemCfg.some((item) => item.platformKey === key)

// 别名
post = await initPublishMethods.assignInitSlug(post, id, publishCfg)
const slugedPost = await initPublishMethods.assignInitSlug(doc, id, publishCfg)

// 其他属性初始化
let post = _.cloneDeep(slugedPost) as Post
if (!isSys) {
// 平台相关自定义属性(摘要、标签、分类)
const yamlKey = getDynYamlKey(key)
Expand Down

0 comments on commit fd9cfe7

Please sign in to comment.