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
butter-studio
Commits
b4798f0a
Commit
b4798f0a
authored
Jul 19, 2021
by
한규민
Browse files
서버연동
parent
c71167c9
Changes
18
Show whitespace changes
Inline
Side-by-side
.env.development
deleted
100644 → 0
View file @
c71167c9
PG_DATABASE=butterDB
PG_USER=butter
PG_PASSWORD=butter
TMDB_APP_KEY=1477348488076cafd4dcf973a314957d
REACT_APP_KAKAO_KEY=a04f2d1d1722f5fbadd556e742465d9f
client/.gitignore
View file @
b4798f0a
...
...
@@ -18,7 +18,6 @@
.env.development.local
.env.test.local
.env.production.local
.env
npm-debug.log*
yarn-debug.log*
...
...
client/src/apis/auth.api.js
0 → 100644
View file @
b4798f0a
import
axios
from
"
axios
"
;
import
{
baseUrl
}
from
"
../utils/baseUrl.js
"
;
import
config
from
"
../utils/clientConfig.js
"
;
const
login
=
async
(
id
,
password
)
=>
{
const
payload
=
{
id
,
password
};
const
{
data
}
=
await
axios
.
post
(
`
${
baseUrl
}
/api/auth/login`
,
payload
);
return
data
};
const
logout
=
async
()
=>
{
alert
(
"
로그아웃되었습니다.
"
);
localStorage
.
removeItem
(
config
.
loginUser
);
await
axios
.
get
(
`
${
baseUrl
}
/api/auth/logout`
);
};
const
signup
=
async
(
user
)
=>
{
const
url
=
`
${
baseUrl
}
/api/auth/signup`
await
axios
.
post
(
url
,
user
)
}
const
compareId
=
async
(
userId
)
=>
{
const
url
=
`
${
baseUrl
}
/api/auth/
${
userId
}
`
const
{
data
}
=
await
axios
.
get
(
url
)
return
data
}
const
authApi
=
{
login
,
logout
,
signup
,
compareId
,
};
export
default
authApi
\ No newline at end of file
client/src/components/BoxOffice/BoxOffice.js
View file @
b4798f0a
import
axios
from
"
axios
"
<<<<<<<
HEAD
import
baseUrl
from
'
../../utils/baseUrl
'
import
React
,
{
useState
,
useEffect
}
from
"
react
"
import
"
./box-office.module.scss
"
// import "./mystyle.css"
=======
import
{
baseUrl
}
from
'
../../utils/baseUrl
'
import
React
,
{
useState
,
useEffect
}
from
"
react
"
import
{
baseUrl
}
from
'
../../utils/baseUrl.js
'
import
{
useState
,
useEffect
}
from
"
react
"
import
styles
from
"
./box-office.module.scss
"
>>>>>>>
kimpen
const
BoxOffice
=
()
=>
{
const
[
TMDB_TopRated_Data
,
setTMDB_TopRated_Data
]
=
useState
()
...
...
@@ -43,13 +35,13 @@ const BoxOffice = () => {
return
(
<
div
className
=
"
container text-center my-3
"
>
{
console
.
log
(
typeof
(
TMDB_TopRated_Data
))}
{
console
.
log
(
typeof
(
TMDB_TopRated_Data
))}
<
div
className
=
"
row my-auto justify-content-center
"
>
<
div
id
=
"
recipeCarousel
"
className
=
"
carousel slide
"
data
-
bs
-
ride
=
"
carousel
"
data
-
bs
-
interval
=
"
999999999
"
>
<
div
className
=
{
`carousel-inner`
}
role
=
"
listbox
"
>
{
TMDB_TopRated_Data
?
TMDB_TopRated_Data
.
map
((
moviePoster
,
index
)
=>
(
<
div
className
=
{
`carousel-item
${
index
===
0
?
"
active
"
:
""
}
`
}
>
{
TMDB_TopRated_Data
?
TMDB_TopRated_Data
.
map
((
moviePoster
,
index
)
=>
(
<
div
className
=
{
`carousel-item
${
index
===
0
?
"
active
"
:
""
}
`
}
>
<
div
className
=
"
col-sm-3
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
card-img
"
>
...
...
@@ -59,7 +51,7 @@ const BoxOffice = () => {
<
/div
>
<
/div
>
))
:
(
<
div
>
영화를
불러올
수
없습니다
:(
<
/div>
)
}
:
(
<
div
>
영화를
불러올
수
없습니다
:(
<
/div>
)
}
<
/div
>
<
a
className
=
"
carousel-control-prev bg-transparent w-aut
"
href
=
"
#recipeCarousel
"
role
=
"
button
"
data
-
bs
-
slide
=
"
prev
"
>
...
...
@@ -72,88 +64,6 @@ const BoxOffice = () => {
<
/div
>
<
/div
>
<
/div
>
// <div className="container">
// <h2 className="fw-bold text-white text-center mt-5">Box Office</h2>
// <div id="multi-carousel" className={`d-flex carousel slide align-items-center ${styles.customHeight}`} data-bs-ride="carousel">
// <div className="carousel-inner row">
// <div className="carousel-item active">
// <div className="col-sm-3">
// <div className="card bg-dark">
// <div className={`card-img ${styles.cursor} ${styles.showplot}`}>
// <img src="//via.placeholder.com/500x400/31f?text=1" className="img-fluid" />
// </div>
// <div className={`card-img-overlay text-white ${styles.dNone}`}>Slide 1</div>
// <button className="btn btn-warning text-white my-1" onClick={(e) => console.log("click", e)}>예매하기</button>
// </div>
// </div>
// </div>
// <div className="carousel-item">
// <div className="col-sm-3">
// <div className="card bg-dark">
// <div className={`card-img ${styles.cursor} ${styles.showplot}`}>
// <img src="//via.placeholder.com/500x400/e66?text=2" className="img-fluid" />
// </div>
// <div className={`card-img-overlay text-white ${styles.dNone}`}>Slide 2</div>
// <button className="btn btn-warning text-white my-1" onClick={(e) => console.log("click", e)}>예매하기</button>
// </div>
// </div>
// </div>
// <div className="carousel-item">
// <div className="col-sm-3">
// <div className="card bg-dark">
// <div className={`card-img ${styles.cursor} ${styles.showplot}`}>
// <img src="//via.placeholder.com/500x400/7d2?text=3" className="img-fluid" />
// </div>
// <div className={`card-img-overlay text-white ${styles.dNone}`}>Slide 3</div>
// <button className="btn btn-warning text-white my-1" onClick={(e) => console.log("click", e)}>예매하기</button>
// </div>
// </div>
// </div>
// <div className="carousel-item">
// <div className="col-sm-3">
// <div className="card bg-dark">
// <div className={`card-img ${styles.cursor} ${styles.showplot}`}>
// <img src="//via.placeholder.com/500x400?text=4" className="img-fluid" />
// </div>
// <div className={`card-img-overlay text-white ${styles.dNone}`}>Slide 4</div>
// <button className="btn btn-warning text-white my-1" onClick={(e) => console.log("click", e)}>예매하기</button>
// </div>
// </div>
// </div>
// <div className="carousel-item">
// <div className="col-sm-3">
// <div className="card bg-dark">
// <div className={`card-img ${styles.cursor} ${styles.showplot}`}>
// <img src="//via.placeholder.com/500x400/aba?text=5" className="img-fluid" />
// </div>
// <div className={`card-img-overlay text-white ${styles.dNone}`}>Slide 5</div>
// <button className="btn btn-warning text-white my-1" onClick={(e) => console.log("click", e)}>예매하기</button>
// </div>
// </div>
// </div>
// <div className="carousel-item">
// <div className="col-sm-3">
// <div className="card bg-dark">
// <div className={`card-img ${styles.cursor} ${styles.showplot}`}>
// <img src="//via.placeholder.com/500x400/fc0?text=6" className="img-fluid" />
// </div>
// <div className={`card-img-overlay text-white ${styles.dNone}`}>Slide 6</div>
// <button className="btn btn-warning text-white my-1" onClick={(e) => console.log("click", e)}>예매하기</button>
// </div>
// </div>
// </div>
// </div>
// <button className="carousel-control-prev" type="button" data-bs-target="#multi-carousel" data-bs-slide="prev">
// <span className="carousel-control-prev-icon" aria-hidden="true"></span>
// <span className="visually-hidden">Previous</span>
// </button>
// <button className="carousel-control-next" type="button" data-bs-target="#multi-carousel" data-bs-slide="next">
// <span className="carousel-control-next-icon" aria-hidden="true"></span>
// <span className="visually-hidden">Next</span>
// </button>
// </div>
// </div>
)
}
...
...
client/src/components/Login/Login.js
View file @
b4798f0a
...
...
@@ -5,10 +5,11 @@ const Login = () => {
//useState를 이용해서 각 state 생성 및 초기값 저장
const
[
state
,
setState
]
=
useState
(
true
);
// 이 줄은 css에 해당하는 state
//state변수 지정 하지만 이 변수는 react에 의해 없어지지 않음, 그리고 그 다음 변수는 state변수를 갱신해주는 함수
const
[
login
Text
,
setLogin
Text
]
=
useState
({
const
[
login
,
setLogin
]
=
useState
({
id
:
''
,
password
:
''
});
const
[
success
,
setSuccess
]
=
useState
(
false
);
const
[
guestText
,
setGusetText
]
=
useState
({
guestName
:
''
,
...
...
@@ -21,7 +22,7 @@ const Login = () => {
const
handleLoginOnChange
=
(
e
)
=>
{
// ... 전개 연산자
// 현재 state에 방금 변화한 값을 다시 저장함
setLogin
Text
({
...
login
Text
,
setLogin
({
...
login
,
[
e
.
target
.
name
]:
e
.
target
.
value
})
};
...
...
@@ -35,7 +36,7 @@ const Login = () => {
return
(
<
div
className
=
{
`d-flex flex-column col-md-5 col-10`
}
>
{
/* nav-tabs */
}
{
/* {console.log(login
Text
)} */
}
{
/* {console.log(login)} */
}
<
ul
className
=
"
nav nav-fill nav-tabs w-100
"
id
=
"
loginTab
"
role
=
"
tablist
"
>
<
li
className
=
"
nav-item fs-6
"
role
=
"
presentation
"
>
<
button
className
=
{
`nav-link active px-2
${
styles
.
fontSize
}
`
}
style
=
{{
color
:
state
?
"
black
"
:
"
#FEDC00
"
,
backgroundColor
:
state
?
"
#FEDC00
"
:
"
black
"
}}
...
...
client/src/components/MovieChart/MovieChart.js
View file @
b4798f0a
import
React
,{
useState
,
useEffect
}
from
'
react
'
import
axios
from
'
axios
'
import
baseUrl
from
'
../../utils/baseUrl
'
import
{
baseUrl
}
from
'
../../utils/baseUrl
.js
'
import
{
Link
}
from
'
react-router-dom
'
;
import
styles
from
"
./movieChart.module.scss
"
...
...
client/src/components/MovieComming/MovieComming.js
View file @
b4798f0a
import
React
,{
useState
,
useEffect
}
from
'
react
'
import
axios
from
'
axios
'
import
baseUrl
from
'
../../utils/baseUrl
'
import
{
baseUrl
}
from
'
../../utils/baseUrl
.js
'
import
{
Link
}
from
'
react-router-dom
'
;
import
styles
from
"
./movieComming.module.scss
"
...
...
client/src/components/Signup/Signup.js
View file @
b4798f0a
import
styles
from
"
./signup.module.scss
"
;
import
{
useState
}
from
'
react
'
;
import
{
useState
,
useEffect
}
from
'
react
'
;
import
authApi
from
"
../../apis/auth.api.js
"
;
import
{
Redirect
}
from
"
react-router
"
;
import
catchErrors
from
"
../../utils/catchErrors.js
"
;
const
Signup
=
()
=>
{
const
[
userText
,
setUserText
]
=
useState
({
const
[
user
,
setUser
]
=
useState
({
userId
:
''
,
userName
:
''
,
userBirthday
:
''
,
...
...
@@ -11,8 +13,12 @@ const Signup = () => {
userPassword
:
''
,
userRePassword
:
''
})
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
success
,
setSuccess
]
=
useState
(
false
);
//각 타입별 error 유무 state
const
[
errors
,
setErrors
]
=
useState
({
const
[
error
,
setError
]
=
useState
(
""
);
const
[
errorMsg
,
setErrorMsg
]
=
useState
({
errorId
:
null
,
errorName
:
false
,
errorBirthday
:
false
,
...
...
@@ -26,87 +32,108 @@ const Signup = () => {
//입력할때마다 state에 저장
const
handleUserOnChange
=
(
e
)
=>
{
setUser
Text
({
...
user
Text
,
setUser
({
...
user
,
[
e
.
target
.
name
]:
e
.
target
.
value
})
}
//id(중복확인 체크, 형식 에러)
const
handleOnClickId
=
(
e
)
=>
{
if
(
userText
.
userId
.
length
<
5
)
{
const
handleOnClickId
=
async
(
e
)
=>
{
e
.
preventDefault
();
// e.stopPropagati//on();
setErrors
(
errors
=>
({
...
errors
,
const
existId
=
await
authApi
.
compareId
(
user
.
userId
)
if
(
user
.
userId
.
length
<
5
)
{
setErrorMsg
(
errorMsg
=>
({
...
errorMsg
,
[
e
.
target
.
name
]:
true
}));
if
(
overlap
Id
===
true
)
{
setOverlapId
(
false
);
if
(
exist
Id
===
true
)
{
setOverlapId
(()
=>
(
false
)
)
;
};
}
else
{
e
.
preventDefault
();
e
.
stopPropagation
();
setErrors
(
errors
=>
({
...
errors
,
setErrorMsg
(
errorMsg
=>
({
...
errorMsg
,
[
e
.
target
.
name
]:
false
}));
setOverlapId
(
true
);
setOverlapId
(()
=>
(
true
));
alert
(
"
이 아이디는 사용가능합니다.
"
)
}
}
const
handleOnSummit
=
async
(
e
)
=>
{
e
.
preventDefault
();
try
{
setError
(
""
);
//처리가 될때까지 버튼(가입하기)이 안눌리게 지정
setLoading
(
true
);
//유효성 검사
validation
();
const
userData
=
user
;
//서버로 전송
await
authApi
.
signup
(
userData
)
alert
(
"
가입이 완료되었습니다. 로그인 해주세요.
"
);
setSuccess
(
true
);
}
catch
(
error
)
{
//에러전송
catchErrors
(
error
,
setError
);
}
finally
{
setLoading
(
false
);
}
}
//유효성 검사 함수
const
vaildationData
=
(
text
,
compareValue
,
error
)
=>
{
if
(
text
!==
compareValue
)
{
setError
s
(
error
s
=>
({
...
error
s
,
[
error
]:
true
}))
setError
Msg
(
error
Msg
=>
({
...
error
Msg
,
[
error
]:
true
}))
;
}
else
{
setError
s
(
error
s
=>
({
...
error
s
,
[
error
]:
false
}))
setError
Msg
(
error
Msg
=>
({
...
error
Msg
,
[
error
]:
false
}))
;
}
}
//가입하기와 동시에 유효성 검사
const
handleonSubmit
=
(
e
)
=>
{
e
.
preventDefault
();
setPreId
(()
=>
(
userText
.
userId
));
console
.
log
(
preId
);
//유효성 검사
const
validation
=
()
=>
{
setPreId
(()
=>
(
user
.
userId
));
//아이디 유효성 검사
if
((
user
Text
.
userId
.
length
<
5
))
{
setError
s
(
error
s
=>
({
...
error
s
,
errorId
:
true
}));
}
else
if
((
user
Text
.
userId
.
length
>=
5
)
&&
(
overlapId
===
true
)){
if
(
preId
!==
user
Text
.
userId
){
if
((
user
.
userId
.
length
<
5
))
{
setError
Msg
(
error
Msg
=>
({
...
error
Msg
,
errorId
:
true
}));
}
else
if
((
user
.
userId
.
length
>=
5
)
&&
(
overlapId
===
true
)){
if
(
preId
!==
user
.
userId
){
console
.
log
(
preId
);
setOverlapId
(()
=>
(
false
));
}
}
else
if
(
user
Text
.
userId
>=
5
){
setError
s
(
error
s
=>
({
...
error
s
,
errorId
:
false
}));
else
if
(
user
.
userId
>=
5
){
setError
Msg
(
error
Msg
=>
({
...
error
Msg
,
errorId
:
false
}));
}
console
.
log
(
preId
);
//별명 에러유무 검사
vaildationData
((
userText
.
userName
.
length
===
0
),
false
,
"
errorName
"
);
// 생일 에러유무 검사
vaildationData
(
userText
.
userBirthday
.
length
,
6
,
"
errorBirthday
"
);
// 휴대폰 에러유무 검사
vaildationData
(
userText
.
userMbnum
.
length
,
11
,
"
errorMbnum
"
);
// 비밀번호 에러유무 검사
vaildationData
(
userText
.
userPassword
.
length
,
8
,
"
errorPassword
"
);
// 비밀번호 확인 에러유무 검사
vaildationData
(
userText
.
userRePassword
,
userText
.
userPassword
,
"
errorRePassword
"
);
const
errorArray
=
Object
.
values
(
errors
);
//별명 유효성 검사
vaildationData
((
user
.
userName
.
length
===
0
),
false
,
"
errorName
"
);
// 생일 유효성 검사
vaildationData
(
user
.
userBirthday
.
length
,
6
,
"
errorBirthday
"
);
// 휴대폰 유효성 검사
vaildationData
(
user
.
userMbnum
.
length
,
11
,
"
errorMbnum
"
);
// 비밀번호 유효성 검사
vaildationData
(
user
.
userPassword
.
length
,
8
,
"
errorPassword
"
);
// 비밀번호 확인 유효성 검사
vaildationData
(
user
.
userRePassword
,
user
.
userPassword
,
"
errorRePassword
"
);
// 최종 유효성 검사
if
(
overlapId
&&
(
errorArray
.
some
((
element
)
=>
(
element
))
===
false
))
{
console
.
log
(
userText
);
setTimeout
(()
=>
{
console
.
log
(
"
회원가입을 완료했습니다.
"
)},
2000
)
if
(
overlapId
&&
(
Object
.
values
(
errorMsg
).
some
((
element
)
=>
(
element
))
===
false
))
{
console
.
log
(
"
;sadasda
"
)
}
else
{
console
.
log
(
"
에러발생
"
)
throw
new
Error
(
"
유효하지 않은 데이터입니다.
"
);
}
}
if
(
success
)
{
return
<
Redirect
to
=
"
/login
"
/>
;
}
return
(
// 데이터 입력과 유효성 검사 후 보이는 경고창
<
form
className
=
{
`d-flex col-md-6 col-12 justify-content-center`
}
>
{
console
.
log
(
"
user
Text
==
"
,
user
Text
,
error
s
,
overlapId
)}
<
form
className
=
{
`d-flex col-md-6 col-12 justify-content-center`
}
onSubmit
=
{
handleOnSummit
}
>
{
console
.
log
(
"
user==
"
,
user
,
error
Msg
,
overlapId
)}
<
div
className
=
"
d-flex flex-column
"
>
<
span
className
=
{
styles
.
title
}
>
회원가입
<
/span
>
<
div
className
=
"
d-flex flex-column
"
>
...
...
@@ -114,12 +141,12 @@ const Signup = () => {
<
label
className
=
{
styles
.
signupLabel
}
>
아이디
<
/label
>
<
div
className
=
"
d-flex col-md-auto
"
>
<
input
className
=
{
styles
.
input
}
type
=
"
text
"
name
=
"
userId
"
id
=
"
userId
"
placeholder
=
"
5~10자리 사이
"
onChange
=
{
handleUserOnChange
}
maxLength
=
"
10
"
required
/>
<
button
type
=
"
button
"
name
=
"
errorId
"
className
=
{
`rounded-2 mt-2
${
styles
.
butterYellowAndBtn
}
${
styles
.
btnHover
}
`
}
onClick
=
{
handleOnClickId
}
data
-
bs
-
toggle
=
"
modal
"
data
-
bs
-
target
=
"
#exampleModal
"
>
중복확인
<
/button
>
<
button
type
=
"
button
"
name
=
"
errorId
"
className
=
{
`rounded-2 mt-2
${
styles
.
butterYellowAndBtn
}
${
styles
.
btnHover
}
`
}
onClick
=
{
handleOnClickId
}
>
중복확인
<
/button
>
<
/div
>
<
/div
>
{(
overlapId
===
false
)
&&
error
s
.
errorId
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
5
~
10
자리
사이로
입력해주세요
.
<
/p>
}
{
overlapId
&&
(
error
s
.
errorId
===
false
)
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
아이디
중복이
확인되었습니다
.
<
/p>
}
{(
error
s
.
errorId
===
false
)
&&
(
overlapId
===
false
)
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
아이디
중복확인을
해주세요
.
<
/p>
}
{(
overlapId
===
false
)
&&
error
Msg
.
errorId
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
5
~
10
자리
사이로
입력해주세요
.
<
/p>
}
{
overlapId
&&
(
error
Msg
.
errorId
===
false
)
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
아이디
중복이
확인되었습니다
.
<
/p>
}
{(
error
Msg
.
errorId
===
false
)
&&
(
overlapId
===
false
)
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
아이디
중복확인을
해주세요
.
<
/p>
}
<
/div
>
<
div
className
=
"
d-flex flex-column
"
>
...
...
@@ -127,7 +154,7 @@ const Signup = () => {
<
label
className
=
{
styles
.
signupLabel
}
>
별명
<
/label
>
<
input
className
=
{
`
${
styles
.
input
}
${
styles
.
inputSize
}
`
}
type
=
"
text
"
name
=
"
userName
"
id
=
"
userName
"
placeholder
=
"
10자리 이내
"
onChange
=
{
handleUserOnChange
}
maxLength
=
"
10
"
required
/>
<
/div
>
{
error
s
.
errorName
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
10
자
이내로
입력해주세요
.
<
/p>
}
{
error
Msg
.
errorName
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
10
자
이내로
입력해주세요
.
<
/p>
}
<
/div
>
<
div
className
=
"
d-flex flex-column
"
>
...
...
@@ -135,7 +162,7 @@ const Signup = () => {
<
label
className
=
{
styles
.
signupLabel
}
>
생년월일
<
/label
>
<
input
className
=
{
`
${
styles
.
input
}
${
styles
.
inputSize
}
${
styles
.
input
.
placeholder
}
`
}
type
=
"
number
"
name
=
"
userBirthday
"
id
=
"
userBirthday
"
placeholder
=
"
6자리(예시: 991225)
"
onChange
=
{
handleUserOnChange
}
min
=
"
0
"
max
=
"
999999
"
required
/>
<
/div
>
{
error
s
.
errorBirthday
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
숫자
6
자리를
입력해주세요
.
<
/p>
}
{
error
Msg
.
errorBirthday
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
숫자
6
자리를
입력해주세요
.
<
/p>
}
<
/div
>
<
div
className
=
"
d-flex flex-column
"
>
...
...
@@ -143,7 +170,7 @@ const Signup = () => {
<
label
className
=
{
styles
.
signupLabel
}
>
휴대폰
번호
<
/label
>
<
input
className
=
{
`
${
styles
.
input
}
${
styles
.
inputSize
}
`
}
type
=
"
number
"
name
=
"
userMbnum
"
id
=
"
userMbnum
"
placeholder
=
"
-없이 11자리 입력
"
onChange
=
{
handleUserOnChange
}
min
=
"
0
"
max
=
"
99999999999
"
required
/>
<
/div
>
{
error
s
.
errorMbnum
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>-
없이
숫자
11
자리를
입력해주세요
.
<
/p>
}
{
error
Msg
.
errorMbnum
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>-
없이
숫자
11
자리를
입력해주세요
.
<
/p>
}
<
/div
>
<
div
className
=
"
d-flex flex-column
"
>
...
...
@@ -151,7 +178,7 @@ const Signup = () => {
<
label
className
=
{
styles
.
signupLabel
}
>
비밀번호
<
/label
>
<
input
className
=
{
`
${
styles
.
input
}
${
styles
.
inputSize
}
`
}
type
=
"
password
"
name
=
"
userPassword
"
id
=
"
password
"
placeholder
=
"
8자리 입력
"
onChange
=
{
handleUserOnChange
}
maxLength
=
"
8
"
required
/>
<
/div
>
{
error
s
.
errorPassword
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
8
자리를
입력해주세요
.
<
/p>
}
{
error
Msg
.
errorPassword
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
8
자리를
입력해주세요
.
<
/p>
}
<
/div
>
<
div
className
=
"
d-flex flex-column
"
>
...
...
@@ -159,26 +186,10 @@ const Signup = () => {
<
label
className
=
{
styles
.
signupLabel
}
>
비밀번호
확인
<
/label
>
<
input
className
=
{
`
${
styles
.
input
}
${
styles
.
inputSize
}
`
}
type
=
"
password
"
name
=
"
userRePassword
"
id
=
"
userRePassword
"
placeholder
=
"
8자리 입력
"
onChange
=
{
handleUserOnChange
}
maxLength
=
"
8
"
required
/>
<
/div
>
{
error
s
.
errorRePassword
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
비밀번호가
일치하지
않습니다
.
<
/p>
}
{
error
Msg
.
errorRePassword
&&
<
p
className
=
{
styles
.
passwordConfirmError
}
>
비밀번호가
일치하지
않습니다
.
<
/p>
}
<
/div
>
<
buttom
className
=
{
`rounded my-3 py-2 fs-5
${
styles
.
butterYellowAndBtn
}
${
styles
.
btnHover
}
`
}
type
=
"
submit
"
onClick
=
{
handleonSubmit
}
>
가입하기
<
/buttom
>
<
/div
>
{
/* 아이디 중복 확인 모달창 */
}
<
div
class
=
"
modal fade
"
id
=
"
exampleModal
"
tabindex
=
"
-1
"
aria
-
labelledby
=
"
exampleModalLabel
"
aria
-
hidden
=
"
true
"
>
<
div
class
=
"
modal-dialog
"
>
<
div
class
=
"
modal-content
"
>
<
div
class
=
"
modal-header
"
>
<
h5
class
=
"
modal-title
"
id
=
"
exampleModalLabel
"
>
아이디
중복
확인
<
/h5
>
<
/div
>
<
div
class
=
"
modal-body
"
>
이
아이디는
사용가능합니다
.
<
/div
>
<
div
class
=
"
modal-footer
"
>
<
button
type
=
"
button
"
className
=
"
btn btn-secondary
"
data
-
bs
-
dismiss
=
"
modal
"
>
닫기
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
button
className
=
{
`rounded my-3 py-2 fs-5
${
styles
.
butterYellowAndBtn
}
${
styles
.
btnHover
}
`
}
type
=
"
submit
"
disabled
=
{
loading
}
>
가입하기
<
/button
>
<
/div
>
<
/form
>
)
...
...
client/src/components/Signup/signup.module.scss
View file @
b4798f0a
...
...
@@ -65,12 +65,6 @@ border: 1px solid white ;
text-align
:
center
;
}
.btnHover
:focus
{
background-color
:
#f5e685
;
color
:
black
;
border-color
:
none
;
box-shadow
:
none
;
}
.passwordConfirmError
{
margin-bottom
:
0
;
margin-top
:
0
.5rem
;
...
...
package-lock.json
View file @
b4798f0a
...
...
@@ -1088,9 +1088,9 @@
"integrity"
:
"sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"nodemon"
:
{
"version"
:
"2.0.
7
"
,
"resolved"
:
"https://registry.npmjs.org/nodemon/-/nodemon-2.0.
7
.tgz"
,
"integrity"
:
"sha512-
XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyF
OA=="
,
"version"
:
"2.0.
12
"
,
"resolved"
:
"https://registry.npmjs.org/nodemon/-/nodemon-2.0.
12
.tgz"
,
"integrity"
:
"sha512-
egCTmNZdObdBxUBw6ZNwvZ/xzk24CKRs5K6d+5zbmrMr7rOpPmfPeF6OxM3DDpaRx331CQRFEktn+wrFFfBS
OA=="
,
"dev"
:
true
,
"requires"
:
{
"chokidar"
:
"^3.2.2"
,
...
...
package.json
View file @
b4798f0a
...
...
@@ -28,6 +28,6 @@
"
sequelize
"
:
"
^6.6.4
"
},
"devDependencies"
:
{
"
nodemon
"
:
"
^2.0.
7
"
"
nodemon
"
:
"
^2.0.
12
"
}
}
server/app.js
View file @
b4798f0a
import
express
from
'
express
'
import
cookieParser
from
'
cookie-parser
'
import
mainRouter
from
'
./routes/index.js
'
import
movieRouter
from
'
./routes/movie.route.js
'
const
app
=
express
()
...
...
server/controllers/movie.controller.js
View file @
b4798f0a
...
...
@@ -69,9 +69,6 @@ const upcommingMovie = async (req, res) => {
}
}
<<<<<<<
HEAD
export
default
{
comparePopularMovie
,
upcommingMovie
}
=======
const
create
=
async
(
req
,
res
)
=>
{
try
{
const
{
movieId
}
=
req
.
params
...
...
@@ -86,4 +83,3 @@ export default {
comparePopularMovie
,
create
,
}
>>>>>>>
kimpen
server/controllers/user.controller.js
0 → 100644
View file @
b4798f0a
import
axios
from
'
axios
'
import
sequelize
from
'
sequelize
'
import
{
User
}
from
'
../db/index.js
'
const
compareId
=
async
(
req
,
res
)
=>
{
const
id
=
req
.
params
.
userId
;
const
userid
=
await
User
.
findAll
({
where
:{
userId
:
id
}});
if
(
userid
){
return
res
.
json
(
true
);
}
else
{
return
res
.
json
(
false
);
}
}
export
default
{
compareId
}
server/db/index.js
View file @
b4798f0a
import
{
Sequelize
}
from
"
sequelize
"
;
//
import UserModel from "../models/user.model.js";
import
UserModel
from
"
../models/user.model.js
"
;
import
MovieModel
from
"
../models/movie.model.js
"
;
import
dbConfig
from
"
../config/db.config.js
"
;
...
...
@@ -19,11 +19,11 @@ const sequelize = new Sequelize(
}
);
//
const User = UserModel(sequelize)
const
User
=
UserModel
(
sequelize
)
const
Movie
=
MovieModel
(
sequelize
)
export
{
sequelize
,
//
User,
User
,
Movie
}
\ No newline at end of file
server/index.js
View file @
b4798f0a
...
...
@@ -34,3 +34,5 @@ sequelize
.
catch
((
err
)
=>
{
console
.
log
(
err
);
});
export
default
{}
\ No newline at end of file
server/routes/index.js
View file @
b4798f0a
import
express
from
"
express
"
;
import
userRouter
from
'
./user.route.js
'
import
movieRouter
from
'
./movie.route.js
'
const
router
=
express
.
Router
();
router
.
use
(
'
/movie
'
,
movieRouter
)
router
.
use
(
'
/auth
'
,
userRouter
)
export
default
router
;
\ No newline at end of file
server/routes/user.route.js
0 → 100644
View file @
b4798f0a
import
express
from
"
express
"
;
import
userCtrl
from
"
../controllers/user.controller.js
"
;
const
router
=
express
.
Router
();
router
.
route
(
"
/
"
)
.
post
()
.
get
()
router
.
route
(
"
/:userId
"
)
.
get
(
userCtrl
.
compareId
)
export
default
router
;
\ No newline at end of file
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