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
Hide 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,28 +33,26 @@ function GetLocFirst() {
padding
:
'
0
'
}
const
[
existLoc
,
setExistLoc
]
=
useState
(
''
)
const
[
show
,
setShow
]
=
useState
(
false
)
useEffect
(()
=>
{
callUserInfo
().
then
((
res
)
=>
{
setExistLoc
(
res
[
0
][
'
loc_code
'
])
if
(
isLogined
())
{
const
existLoc
=
res
[
0
][
'
loc_code
'
]
if
(
existLoc
===
null
)
{
setTimeout
(
function
()
{
setShow
(
true
)
},
1000
)
}
else
{
console
.
log
(
'
Already has Loc_code
'
)
window
.
location
.
replace
(
'
/
'
)
}
}
})
},
[])
useEffect
(()
=>
{
if
(
existLoc
===
''
)
{
setTimeout
(
function
()
{
setShow
(
true
)
},
1500
)
}
else
{
setShow
(
false
)
window
.
location
.
replace
(
'
/
'
)
}
},
[
existLoc
])
return
(
<
Container
className
=
'
m-auto d-flex position-relative
'
...
...
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