From 7f4ee54ffbd943f0e25ace5d9c15e168fb700e12 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Thu, 24 Nov 2022 22:59:06 +0800 Subject: [PATCH] perf: back to post list when post is first created (#709) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: 首次创建文章或者自定义页面时,跳转回管理列表,与编辑保持一致。 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式:创建一篇新的文章或自定义页面,点击发布,观察是否返回到了管理列表。 #### Does this PR introduce a user-facing change? ```release-note None ``` --- src/modules/contents/pages/SinglePageEditor.vue | 1 + src/modules/contents/posts/PostEditor.vue | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/modules/contents/pages/SinglePageEditor.vue b/src/modules/contents/pages/SinglePageEditor.vue index fd30e580..868df535 100644 --- a/src/modules/contents/pages/SinglePageEditor.vue +++ b/src/modules/contents/pages/SinglePageEditor.vue @@ -140,6 +140,7 @@ const handlePublish = async () => { await apiClient.singlePage.draftSinglePage({ singlePageRequest: formState.value, }); + router.push({ name: "SinglePages" }); } Toast.success("发布成功"); diff --git a/src/modules/contents/posts/PostEditor.vue b/src/modules/contents/posts/PostEditor.vue index 7c531bb9..5ed9dbca 100644 --- a/src/modules/contents/posts/PostEditor.vue +++ b/src/modules/contents/posts/PostEditor.vue @@ -144,6 +144,8 @@ const handlePublish = async () => { await apiClient.post.publishPost({ name: data.metadata.name, }); + + router.push({ name: "Posts" }); } Toast.success("发布成功", { duration: 2000 });