[라우터 방식 변경]
This commit is contained in:
@@ -101,11 +101,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useUserStore } from "~/stores/user";
|
||||
|
||||
// onMounted(() => {
|
||||
// console.log("index.vue - onMounted");
|
||||
// router.push("/1/");
|
||||
// });
|
||||
|
||||
// 페이지 메타데이터 설정
|
||||
definePageMeta({
|
||||
title: "Home",
|
||||
|
||||
@@ -71,9 +71,9 @@ const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 이미 로그인된 경우 홈으로 리다이렉션
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (userStore.isLoggedIn) {
|
||||
router.push("/");
|
||||
await navigateTo("/");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -89,7 +89,7 @@ async function signIn() {
|
||||
const result = await userStore.login(userId.value, password.value);
|
||||
|
||||
if (result.success) {
|
||||
await router.push("/");
|
||||
await navigateTo("/");
|
||||
} else {
|
||||
errorMessage.value = result.error;
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 이미 로그인된 경우 홈으로 리다이렉션
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (userStore.isLoggedIn) {
|
||||
router.push("/");
|
||||
await navigateTo("/");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -133,8 +133,8 @@ async function signUp() {
|
||||
"회원 가입이 완료되었습니다! 로그인 페이지로 이동합니다.";
|
||||
|
||||
// 2초 후 로그인 페이지로 이동
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
setTimeout(async () => {
|
||||
await navigateTo("/login");
|
||||
}, 2000);
|
||||
}
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user