From 500f702e02274c4ebba7b423ecb436d7930e987b Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sat, 19 Oct 2024 23:58:44 +0800 Subject: [PATCH] fix: can not return to post list after publishing when re-logged in (#6902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area ui /kind bug /milestone 2.20.x #### What this PR does / why we need it: 修复通过登录跳转到文章编辑页面时,发布文章会跳转到个人中心的问题。 #### Which issue(s) this PR fixes: Fixes #6901 #### Special notes for your reviewer: 测试步骤: 1. 新建文章,编写内容,但是不发布 2. 在新的浏览器选项卡中退出登录 3. 回到文章编辑页面,跳转到登录页面重新登录之后,发布文章 4. 观察是否会返回到 Console 的文章管理页面。 #### Does this PR introduce a user-facing change? ```release-note 修复通过登录跳转到文章编辑页面时,发布文章会跳转到个人中心的问题。 ``` --- ui/console-src/modules/contents/pages/SinglePageEditor.vue | 2 +- ui/console-src/modules/contents/posts/PostEditor.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/console-src/modules/contents/pages/SinglePageEditor.vue b/ui/console-src/modules/contents/pages/SinglePageEditor.vue index 6287f2e5c..5615d6102 100644 --- a/ui/console-src/modules/contents/pages/SinglePageEditor.vue +++ b/ui/console-src/modules/contents/pages/SinglePageEditor.vue @@ -223,7 +223,7 @@ const handlePublish = async () => { if (returnToView.value && permalink) { window.location.href = permalink; } else { - router.back(); + router.push({ name: "SinglePages" }); } } else { formState.value.page.spec.publish = true; diff --git a/ui/console-src/modules/contents/posts/PostEditor.vue b/ui/console-src/modules/contents/posts/PostEditor.vue index f55527c48..cd783c497 100644 --- a/ui/console-src/modules/contents/posts/PostEditor.vue +++ b/ui/console-src/modules/contents/posts/PostEditor.vue @@ -236,7 +236,7 @@ const handlePublish = async () => { if (returnToView.value === "true" && permalink) { window.location.href = permalink; } else { - router.back(); + router.push({ name: "Posts" }); } } else { const { data } = await consoleApiClient.content.post.draftPost({