fix: can not return to post list after publishing when re-logged in (#6902)

#### 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
修复通过登录跳转到文章编辑页面时,发布文章会跳转到个人中心的问题。
```
pull/6912/head
Ryan Wang 2024-10-19 23:58:44 +08:00 committed by GitHub
parent 833b884bdb
commit 500f702e02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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({