import axios from "axios" export function handleLogin(userId) { //로그인할때 로컬스토리지에 유저 아이디를 설정한다 localStorage.setItem('loginStatus', userId) } export async function handleLogout() { localStorage.removeItem('loginStatus') //로컬스토리지에서 로그인상태를 지운다 await axios.get('/api/auth/logout') //? window.location.href='/' //경로 지정 } //유저가 로그인 했는 지 확인하는 함수 export function isAuthenticated() { const userId = localStorage.getItem('loginStatus') //유저아이디를 로컬스토리지에서 가져와서 저장 if (userId) { return userId }else{ return false } }