fix(page): handle error case for default redirect page update (#1277)

This commit is contained in:
lichunn 2025-04-02 09:20:56 +08:00 committed by GitHub
parent b7164bb57d
commit 87d7d32e5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -310,7 +310,11 @@ export default {
const settingDefaultPage = async () => {
const params = { ...pageSettingState.defaultPage, isDefault: true }
await updatePage(pageSettingState.defaultPage?.id, params, false)
updatePage(pageSettingState.defaultPage?.id, params, false).then((res) => {
if (res) {
editPage()
}
})
}
const createHistoryMessage = () => {
@ -325,7 +329,7 @@ export default {
const exec = () => {
pageSettingState.currentPageData.message = state.historyMessage.trim() || 'Page auto save'
if (pageSettingState.defaultPage?.id) {
settingDefaultPage().then(editPage)
settingDefaultPage()
} else {
editPage()
}