From 9ed8f050e3962d2b84ab5807f1db37d4eaa4a971 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Tue, 10 Jun 2025 12:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=99=BB=E5=BD=95=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Login.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/Login.vue b/src/views/Login.vue index 6997d79..3ca9f83 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -69,9 +69,15 @@ const param = reactive({ password: defParam ? defParam.password : "", }); -onMounted(() => { +onMounted(async () => { // 保存登录参数到本地存储 - getMyUserInfo(localStorage.getItem("userId")); + let res = getMyUserInfo(localStorage.getItem("userId")); + if(res.code === 0){ + // 如果已经登录,跳转到用户页面 + router.push("/user"); + }else{ + window.location.href = "https://sv.ljsea.top/#/login?site=gs-vp"; //https://sv.ljsea.top/ + } }); // 表单验证规则 @@ -145,6 +151,7 @@ const getMyUserInfo = async (id) => { } catch (e) { console.log(e); } + return result; }; // 获取标签存储并清空标签