From b25342303f24de15e75d2f9a38d1b0aaa51e108d Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Fri, 27 Mar 2026 19:09:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20=E8=BF=81=E7=A7=BB=20Vue=20Ro?= =?UTF-8?q?uter=20navigation=20guard=20=E5=88=B0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vue Router 4 已弃用 next() 回调,改为直接返回值 --- dashboard/src/views/ConfigPage.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dashboard/src/views/ConfigPage.vue b/dashboard/src/views/ConfigPage.vue index 5559c33ed..6d01573a3 100644 --- a/dashboard/src/views/ConfigPage.vue +++ b/dashboard/src/views/ConfigPage.vue @@ -386,7 +386,7 @@ export default { }, // 检查未保存的更改 - async beforeRouteLeave(to, from, next) { + async beforeRouteLeave(to, from) { if (this.hasUnsavedChanges) { const confirmed = await this.$refs.unsavedChangesDialog?.open({ title: this.tm('unsavedChangesWarning.dialogTitle'), @@ -397,25 +397,25 @@ export default { }); // 关闭弹窗不跳转 if (confirmed === 'close') { - next(false); + return false; } else if (confirmed) { const result = await this.updateConfig(); if (this.isSystemConfig) { - next(false); + return false; } else { if (result?.success) { await new Promise(resolve => setTimeout(resolve, 800)); - next(); + return true; } else { - next(false); + return false; } } } else { this.hasUnsavedChanges = false; - next(); + return true; } } else { - next(); + return true; } }, props: {