From 3b598fc2bd891190f178b8828481a69f05321e69 Mon Sep 17 00:00:00 2001 From: lihui Date: Sat, 15 Nov 2025 17:35:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=99=BB=E5=BD=95=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=B8=8D=E8=8E=B7=E5=8F=96=E6=B6=88=E6=81=AF=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 7 ++++++- src/views/home.vue | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index b636ed3..d2e0632 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -520,7 +520,12 @@ router.beforeEach(async (to, from, next) => { }); // 全局后置守卫:每次路由切换后执行 -router.afterEach(async () => { +router.afterEach(async (to) => { // 接收to参数获取当前路由信息 + // 判断当前路由是否是登录页,如果是则直接返回不执行后续逻辑 + if (to.path === '/login') { + return; + } + try { // 执行/getMessage请求 const newMessageRes = await API({ diff --git a/src/views/home.vue b/src/views/home.vue index be89c7f..fc9ce6d 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -99,6 +99,9 @@ const messageVisible = ref(false) const openMessage = () => (messageVisible.value = true) const closeMessage = () => (messageVisible.value = false) +const message = function () { + openMessage() +} const showPasswordDialog = ref(false) const pwdRef = ref()