Commit 071ec763 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

로컬 빼빼

parent 458982e1
......@@ -36,10 +36,15 @@ function Payment({ match, location }) {
}, [cart])
async function getUser() {
const name = localStorage.getItem('name')
const tel = localStorage.getItem('tel')
const email = localStorage.getItem('email')
setUserData({ name: name, tel: tel, email: email })
try {
const response = await axios.get(`/api/users/account/${user}`)
console.log(response.data)
const { name, tel, email } = response.data
setUserData({ name: name, tel: tel, email: email })
} catch (error) {
catchErrors(error, setError)
}
// setUserData({ name: name, tel: tel, email: email })
}
async function getCart() {
......
......@@ -3,9 +3,6 @@ import axios from "axios";
export function handleLogin({ userId, role, name, tel, email }) {
localStorage.setItem('id', userId)
localStorage.setItem('role', role)
localStorage.setItem('name', name)
localStorage.setItem('tel', tel)
localStorage.setItem('email', email)
}
export async function handleLogout() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment