Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
shopping-mall
Commits
071ec763
Commit
071ec763
authored
Feb 01, 2021
by
Jiwon Yoon
Browse files
로컬 빼빼
parent
458982e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
client/src/Pages/Payment.js
View file @
071ec763
...
@@ -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
)
setUserData
({
name
:
name
,
tel
:
tel
,
email
:
email
})
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
()
{
async
function
getCart
()
{
...
...
client/src/utils/auth.js
View file @
071ec763
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment