From 40f9ac1a6b19c4f603be6e2d3772a9a089a8d044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Sun, 17 Jul 2022 14:54:45 +0800 Subject: [PATCH] fix: fix incorrent usage of vue router --- src/utils/auth.js | 2 +- src/views/login/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/auth.js b/src/utils/auth.js index a269ef0..9edfad4 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -3,6 +3,6 @@ import { router } from '@/router' export function toLogin() { router.replace({ path: '/login', - query: { ...router.currentRoute.query, redirect: router.currentRoute.path }, + query: { ...router.currentRoute.value.query, redirect: router.currentRoute.value.path }, }) } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 2a5d2cc..992773b 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -53,7 +53,7 @@ import { useStorage } from '@vueuse/core' const title = import.meta.env.VITE_APP_TITLE const router = useRouter() -const query = unref(router.currentRoute).query +const { query } = useRoute() const loginInfo = ref({ name: '',