From 4ca700092a178973eb2fb9bd7893eec17cf6aac5 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 10 May 2024 14:19:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=E5=90=8E=E9=87=8D?= =?UTF-8?q?=E5=AE=9A=E5=90=91=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 4a016406..bf3f4749 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -14,10 +14,6 @@ const appStore = useAppStore(); const router = useRouter(); const route = useRoute(); -/**登录后重定向页面 */ -const redirectPath = - (route.query && (route.query.redirect as string)) || '/index'; - let state = reactive({ /**表单属性 */ from: { @@ -52,7 +48,9 @@ function fnFinish() { .then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success(t('views.login.loginSuccess'), 3); - router.push({ path: redirectPath }); + /**登录后重定向页面 */ + const redirectPath = route.query?.redirect || '/index'; + router.push({ path: redirectPath as string }); } else { message.error(`${res.msg}`, 3); }