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
eue
Commits
0f1b5291
Commit
0f1b5291
authored
Aug 02, 2021
by
Spark
Browse files
first-loc_code 입력시 로그인 여부 확인
parent
5dfc26a1
Changes
1
Show whitespace changes
Inline
Side-by-side
client/src/pages/GetLocFirst.js
View file @
0f1b5291
...
...
@@ -9,6 +9,7 @@ import ChartDoughnut from '../components/ChartDoughnut';
import
Donation
from
'
../components/Donation
'
;
import
LocCodeChange
from
'
../components/LocCodeChange
'
;
import
{
callUserInfo
}
from
'
../utils/CheckDB
'
;
import
{
isLogined
}
from
'
./../utils/Auth
'
;
function
GetLocFirst
()
{
const
constyled
=
{
...
...
@@ -32,27 +33,25 @@ function GetLocFirst() {
padding
:
'
0
'
}
const
[
existLoc
,
setExistLoc
]
=
useState
(
''
)
const
[
show
,
setShow
]
=
useState
(
false
)
useEffect
(()
=>
{
callUserInfo
().
then
((
res
)
=>
{
setExistLoc
(
res
[
0
][
'
loc_code
'
])
})
},
[])
useEffect
(()
=>
{
if
(
existLoc
===
''
)
{
if
(
isLogined
())
{
const
existLoc
=
res
[
0
][
'
loc_code
'
]
if
(
existLoc
===
null
)
{
setTimeout
(
function
()
{
setShow
(
true
)
},
1
5
00
)
},
1
0
00
)
}
else
{
setShow
(
false
)
console
.
log
(
'
Already has Loc_code
'
)
window
.
location
.
replace
(
'
/
'
)
}
},
[
existLoc
])
}
})
},
[])
return
(
...
...
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