diff --git a/src/views/login.vue b/src/views/login.vue index 0d6f19a..8cefc9c 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -142,10 +142,10 @@ export default { Cookies.remove('rememberMe') } this.$store.dispatch("Login", this.loginForm).then(() => { - // 添加小延迟确保路由准备好 - setTimeout(() => { - this.$router.push({ path: this.redirect || "/sloworder/index" }).catch(()=>{}) - }, 500) + // 使用 replace 而不是 push,避免路由历史问题 + this.$nextTick(() => { + window.location.href = this.redirect || "/sloworder/index" + }) }).catch(() => { this.loading = false if (this.captchaEnabled) {