Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
a785d23c
Commit
a785d23c
authored
Jan 16, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance login
parent
661acec7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
120 additions
and
104 deletions
+120
-104
Login.js
src/container/Auth/Login.js
+120
-104
No files found.
src/container/Auth/Login.js
View file @
a785d23c
...
...
@@ -38,7 +38,10 @@ class Login extends Component {
tipeAlert
:
''
,
messageAlert
:
''
,
width
:
0
,
height
:
0
height
:
0
,
maintenanceHeadline
:
""
,
maintenanceContent
:
""
,
maintenanceStatus
:
null
,
}
}
...
...
@@ -98,11 +101,16 @@ class Login extends Component {
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
// console.log(response.data.data)
if
(
response
.
data
.
data
.
role_id
===
185
&&
response
.
data
.
maintenance_mode
===
'ACTIVE'
){
this
.
props
.
history
.
push
(
'/maintenance'
)
let
datas
=
response
.
data
.
data
if
(
datas
.
maintenance_status
===
1
)
{
this
.
setState
({
maintenanceHeadline
:
datas
.
maintenance_headline
,
maintenanceContent
:
datas
.
maintenance_content
,
maintenanceStatus
:
datas
.
maintenance_status
})
}
else
{
localStorage
.
setItem
(
Constant
.
TOKEN
,
response
.
data
.
data
.
token
)
localStorage
.
setItem
(
Constant
.
USER
,
response
.
data
.
data
.
user_id
)
localStorage
.
setItem
(
Constant
.
TOKEN
,
datas
.
token
)
localStorage
.
setItem
(
Constant
.
USER
,
datas
.
user_id
)
if
(
this
.
state
.
rememberMe
)
{
localStorage
.
setItem
(
Constant
.
EMAIL
,
this
.
state
.
email
)
localStorage
.
setItem
(
Constant
.
PASSWORD
,
this
.
state
.
password
)
...
...
@@ -113,6 +121,7 @@ class Login extends Component {
}
this
.
props
.
history
.
push
(
'/home/beranda'
)
}
}
else
{
if
(
response
.
data
.
message
==
'Password is Not Correct'
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Incorrect Password'
})
...
...
@@ -149,18 +158,24 @@ class Login extends Component {
<
/Alert
>
<
/Snackbar
>
<
div
style
=
{{
width
:
'50%'
,
display
:
'grid'
}}
>
<
img
src
=
{
Images
.
meeting
}
style
=
{{
objectFit
:
'fill'
,
width
:
'100%'
,
height
:
'100%'
}}
/
>
<
img
src
=
{
Images
.
meeting
}
style
=
{{
objectFit
:
'fill'
,
width
:
'100%'
,
height
:
'100%'
}}
/
>
{
/* <img src={Images.imageLogin} style={{ marginTop: 30 }} /> */
}
<
/div
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#263b80'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
{
this
.
state
.
maintenanceStatus
===
1
?
<
div
>
<
Typography
style
=
{{
color
:
'#fff'
,
fontSize
:
20
,
margin
:
'10px 40px'
}}
>
{
this
.
state
.
maintenanceHeadline
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'#fff'
,
fontSize
:
20
,
margin
:
40
}}
>
{
this
.
state
.
maintenanceContent
}
<
/Typography
>
<
/div
>
:
<
form
onSubmit
=
{(
e
)
=>
{
e
.
preventDefault
()
this
.
validateLogin
()
}}
>
<
div
style
=
{{
maxWidth
:
397
,
paddingTop
:
56
,
padding
:
65
,
display
:
'flex'
,
flexDirection
:
'column'
,
height
:
(
this
.
state
.
msgEmail
.
length
>
45
?
485
:
441
),
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
}}
>
<
img
src
=
{
Images
.
triputraBlack
}
style
=
{{
height
:
59
,
width
:
175
,
alignSelf
:
'center'
}}
/
>
<
img
src
=
{
Images
.
triputraBlack
}
style
=
{{
height
:
59
,
width
:
175
,
alignSelf
:
'center'
}}
/
>
<
TextField
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
...
...
@@ -230,6 +245,7 @@ class Login extends Component {
<
/button
>
<
/div
>
<
/form
>
}
<
/div
>
<
/div
>
);
...
...
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