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: '',