From ac56a8b916d05f0c849e96162d9a7eafb42c9e4e Mon Sep 17 00:00:00 2001 From: BoYoung00 Date: Tue, 17 Dec 2024 23:11:21 +0900 Subject: [PATCH] =?UTF-8?q?12/17=20root=EC=97=90=20=EB=A0=8C=EB=8D=94?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index aa28cdfb..baa9d029 100644 --- a/src/main.js +++ b/src/main.js @@ -32,6 +32,7 @@ const routeHandlers = () => { const router = () => { let path = window.location.pathname; const user = JSON.parse(localStorage.getItem("user") || "{}"); + const root = document.getElementById("root"); if (path === "/profile" && !user.username) { path = "/login"; @@ -40,9 +41,9 @@ const router = () => { const route = routes[path]; if (route) { - document.body.innerHTML = route(); + root.innerHTML = route(); } else { - document.body.innerHTML = ErrorPage(); + root.innerHTML = ErrorPage(); } if (path === "/login") {