Skip to content

Commit

Permalink
feat: 라이브 코딩쇼 성공
Browse files Browse the repository at this point in the history
  • Loading branch information
seonjo1 committed Aug 29, 2024
1 parent 9f454af commit 1e1fcf6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
13 changes: 0 additions & 13 deletions frontend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ class App {
constructor() {
this.app = document.querySelector("#app");
this.lan = { value: 0 };
fetch("https://localhost:443/api/language/", {
method: 'GET',
credentials: 'include', // 쿠키를 포함하여 요청 (사용자 인증 필요 시)
})
.then(response => {
if (!response.ok){
return null;
}
return response.json();
})
.then(data => {
if (data) this.lan.value = data.language;
});
}
}

Expand Down
18 changes: 17 additions & 1 deletion frontend/src/core/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,23 @@ export const initializeRouter = () => {
window.addEventListener("popstate", async () => {
await parsePath(window.location.pathname);
});
parsePath(window.location.pathname);
fetch("https://localhost:443/api/language/", {
method: 'GET',
credentials: 'include', // 쿠키를 포함하여 요청 (사용자 인증 필요 시)
})
.then(response => {
if (!response.ok){
console.log("so bad");
return null;
}
return response.json();
})
.then(data => {
if (data){
root.lan.value = data.language;
}
parsePath(window.location.pathname);
});
};

async function checkAuth() {
Expand Down

0 comments on commit 1e1fcf6

Please sign in to comment.