From 2e0db524fec2e050873d98485b2d6a8d7da27782 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Mon, 4 Aug 2025 11:35:16 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20:memo:=20=E7=A7=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/components/Login.vue | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/views/login/components/Login.vue b/src/views/login/components/Login.vue index 1e45fca7..0c41ff0f 100644 --- a/src/views/login/components/Login.vue +++ b/src/views/login/components/Login.vue @@ -203,18 +203,11 @@ async function handleLoginSubmit() { await userStore.getUserInfo(); // 4. 登录成功,让路由守卫处理跳转逻辑 - // 解析目标地址,但不直接跳转 const redirect = resolveRedirectTarget(route.query); - console.log("🎉 Login successful, target redirect:", redirect); - // 通过替换当前路由触发路由守卫,让守卫处理后续的路由生成和跳转 await router.replace(redirect); - - // 5. 记住我功能已实现,根据用户选择决定token的存储方式: - // - 选中"记住我": token存储在localStorage中,浏览器关闭后仍然有效 - // - 未选中"记住我": token存储在sessionStorage中,浏览器关闭后失效 } catch (error) { - // 6. 统一错误处理 + // 5. 统一错误处理 getCaptcha(); // 刷新验证码 console.error("登录失败:", error); } finally {