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
bora-it
Commits
1090e69e
Commit
1090e69e
authored
Jul 14, 2021
by
Kim, Chaerin
Browse files
에러해결 및 api 파일 복사
parent
5bc56dd0
Changes
6
Show whitespace changes
Inline
Side-by-side
client/src/apis/endpoints.js
deleted
100644 → 0
View file @
5bc56dd0
const
endpoints
=
{
API_BASE_URL
:
"
http://localhost:8080/api
"
,
ROOM_API
:
"
room
"
,
PROFILE_API
:
"
profile
"
,
};
export
default
endpoints
;
client/src/apis/profile.api.js
View file @
1090e69e
import
axios
from
"
axios
"
;
const
login
=
async
(
payload
)
=>
{
const
{
data
}
=
await
axios
.
post
(
"
/api/login
"
,
payload
);
return
data
;
};
const
signup
=
async
(
payload
)
=>
{
const
{
data
}
=
await
axios
.
post
(
"
/api/signup
"
,
payload
);
return
data
;
};
const
profileApi
=
{
login
,
signup
};
export
default
profileApi
;
client/src/apis/room.api.js
View file @
1090e69e
import
axios
from
"
axios
"
;
const
login
=
async
(
payload
)
=>
{
const
{
data
}
=
await
axios
.
post
(
"
/api/login
"
,
payload
);
return
data
;
};
const
signup
=
async
(
payload
)
=>
{
const
{
data
}
=
await
axios
.
post
(
"
/api/signup
"
,
payload
);
return
data
;
};
const
roomApi
=
{
login
,
signup
};
export
default
roomApi
;
client/src/apis/user.api.js
View file @
1090e69e
import
axios
from
"
axios
"
;
import
endpoints
from
"
./endpoints
"
;
const
login
=
async
(
payload
)
=>
{
const
{
data
}
=
await
axios
.
post
(
`
${
endpoints
.
API_BASE_URL
}
/login`
,
payload
);
console
.
log
(
data
);
const
{
data
}
=
await
axios
.
post
(
"
/api/login
"
,
payload
);
return
data
;
};
const
signup
=
async
(
payload
)
=>
{
const
{
data
}
=
await
axios
.
post
(
`
${
endpoints
.
API_BASE_URL
}
/signup`
,
payload
);
const
{
data
}
=
await
axios
.
post
(
"
/api/signup
"
,
payload
);
return
data
;
};
...
...
client/src/components/Header.js
View file @
1090e69e
...
...
@@ -7,7 +7,7 @@ const Header = () => {
className
=
"
flex-column align-items-center justify-content-center p-2
"
>
<
div
className
=
"
d-flex justify-content-center
"
>
<
Link
to
=
"
/
user
"
>
<
Link
to
=
"
/
"
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
/Link
>
<
/div
>
...
...
client/src/components/Login.js
View file @
1090e69e
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Redirect
}
from
"
react-router-dom
"
;
import
login
from
"
../apis/user.api
"
;
import
userApi
from
"
../apis/user.api
"
;
const
INIT_USER
=
{
email
:
""
,
password
:
""
,
...
...
@@ -28,7 +28,7 @@ const Login = () => {
try
{
// setLoading(true);
// setError("");
const
data
=
await
login
(
user
);
const
data
=
await
userApi
.
login
(
user
);
console
.
log
(
data
);
setSuccess
(
true
);
}
catch
(
error
)
{
...
...
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