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
search-page
Commits
8a09b651
Commit
8a09b651
authored
Jan 25, 2021
by
Lee SeoYeon
Browse files
.
parent
d0e82382
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
client/.eslintcache
View file @
8a09b651
This diff is collapsed.
Click to expand it.
client/src/Components/Login.js
View file @
8a09b651
...
@@ -21,7 +21,7 @@ function Login() {
...
@@ -21,7 +21,7 @@ function Login() {
useEffect
(()
=>
{
//참거짓 판단 값들의 원소들이 element로 들어간다
useEffect
(()
=>
{
//참거짓 판단 값들의 원소들이 element로 들어간다
const
isUser
=
Object
.
values
(
user
).
every
(
el
=>
Boolean
(
el
))
const
isUser
=
Object
.
values
(
user
).
every
(
el
=>
Boolean
(
el
))
isUser
?
setDisabled
(
false
)
:
setDisabled
(
true
)
isUser
?
setDisabled
(
false
)
:
setDisabled
(
true
)
},
[
user
])
},
[
user
])
function
handleChange
(
event
)
{
function
handleChange
(
event
)
{
...
@@ -33,10 +33,10 @@ function Login() {
...
@@ -33,10 +33,10 @@ function Login() {
event
.
preventDefault
()
//리셋을 막는다
event
.
preventDefault
()
//리셋을 막는다
try
{
try
{
setLoading
(
true
)
setLoading
(
true
)
setError
(
''
)
setError
(
''
)
//값을 배열로 설정
const
response
=
await
axios
.
post
(
'
/api/auth/login
'
,
user
)
const
response
=
await
axios
.
post
(
'
/api/auth/login
'
,
user
)
console
.
log
(
response
.
data
)
console
.
log
(
response
.
data
)
handleLogin
(
response
.
data
.
userId
)
handleLogin
(
response
.
data
.
userId
)
//로그인했을때 userid data를 넣는다
setSuccess
(
true
)
setSuccess
(
true
)
}
catch
(
error
)
{
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
catchErrors
(
error
,
setError
)
...
...
client/src/Search.js
View file @
8a09b651
...
@@ -11,7 +11,7 @@ import axios from "axios";
...
@@ -11,7 +11,7 @@ import axios from "axios";
const
INIT_PAGE
=
{
const
INIT_PAGE
=
{
title
:
''
,
title
:
''
,
url
:
''
,
url
:
''
,
}
}
//초기페이지에 타이틀이랑 url 저장
function
Search
(
props
)
{
function
Search
(
props
)
{
const
endPage
=
10
;
const
endPage
=
10
;
...
...
server/utils/connectDb.js
View file @
8a09b651
...
@@ -7,7 +7,7 @@ async function connectDb() {
...
@@ -7,7 +7,7 @@ async function connectDb() {
if
(
connection
.
isConnected
)
{
if
(
connection
.
isConnected
)
{
return
return
}
}
//디비연결
const
db
=
await
mongoose
.
connect
(
config
.
mongoDbUri
,
{
const
db
=
await
mongoose
.
connect
(
config
.
mongoDbUri
,
{
useNewUrlParser
:
true
,
useNewUrlParser
:
true
,
useUnifiedTopology
:
true
,
useUnifiedTopology
:
true
,
...
...
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