Skip to content

Commit

Permalink
fix: 修复发布更新状态判断错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jul 31, 2023
1 parent 37b0235 commit cbc271e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/composables/usePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const usePublish = () => {

setting: {} as typeof SypConfig,
cfg: {} as any,
isAdd: true,
postid: "",
previewUrl: "",
})
Expand All @@ -77,8 +78,9 @@ const usePublish = () => {
}
const postMeta = singleFormData.setting[id] ?? {}
singleFormData.postid = postMeta[posidKey] ?? ""
singleFormData.isAdd = !StrUtil.isEmptyString(singleFormData.postid)

if (StrUtil.isEmptyString(singleFormData.postid)) {
if (singleFormData.isAdd) {
logger.info("文章未发布,准备发布")
const post = new Post()
post.title = doc.title
Expand Down
6 changes: 2 additions & 4 deletions src/workers/quickPublish.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ onMounted(async () => {
发布中,请稍后...:
</div>
<div v-else-if="singleFormData.publishProcessStatus" class="success-tips">
{{ StrUtil.isEmptyString(singleFormData.postid) ? "发布到" : "更新文章到" }} [博客园] 成功,
{{ singleFormData.isAdd ? "发布到" : "更新文章到" }} [博客园] 成功,
<a :href="singleFormData.previewUrl" target="_blank">查看文章</a>
</div>
<div v-else class="fail-tips">
{{ StrUtil.isEmptyString(singleFormData.postid) ? "发布到" : "更新文章到" }} [博客园] 失败!
</div>
<div v-else class="fail-tips">{{ singleFormData.isAdd ? "发布到" : "更新文章到" }} [博客园] 失败!</div>
</div>
</div>
</template>
Expand Down

0 comments on commit cbc271e

Please sign in to comment.