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

로컬 빼빼

parent 458982e1
...@@ -36,10 +36,15 @@ function Payment({ match, location }) { ...@@ -36,10 +36,15 @@ function Payment({ match, location }) {
}, [cart]) }, [cart])
async function getUser() { async function getUser() {
const name = localStorage.getItem('name') try {
const tel = localStorage.getItem('tel') const response = await axios.get(`/api/users/account/${user}`)
const email = localStorage.getItem('email') console.log(response.data)
const { name, tel, email } = response.data
setUserData({ name: name, tel: tel, email: email }) setUserData({ name: name, tel: tel, email: email })
} catch (error) {
catchErrors(error, setError)
}
// setUserData({ name: name, tel: tel, email: email })
} }
async function getCart() { async function getCart() {
......
...@@ -3,9 +3,6 @@ import axios from "axios"; ...@@ -3,9 +3,6 @@ import axios from "axios";
export function handleLogin({ userId, role, name, tel, email }) { export function handleLogin({ userId, role, name, tel, email }) {
localStorage.setItem('id', userId) localStorage.setItem('id', userId)
localStorage.setItem('role', role) localStorage.setItem('role', role)
localStorage.setItem('name', name)
localStorage.setItem('tel', tel)
localStorage.setItem('email', email)
} }
export async function handleLogout() { 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