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
af356595
Commit
af356595
authored
Jan 16, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/riri' into 'ENV-DEV'
maintenance login See merge request
!1667
parents
21ba5a14
e253eae9
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 @
af356595
...
@@ -38,7 +38,10 @@ class Login extends Component {
...
@@ -38,7 +38,10 @@ class Login extends Component {
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
,
messageAlert
:
''
,
width
:
0
,
width
:
0
,
height
:
0
height
:
0
,
maintenanceHeadline
:
""
,
maintenanceContent
:
""
,
maintenanceStatus
:
null
,
}
}
}
}
...
@@ -98,11 +101,16 @@ class Login extends Component {
...
@@ -98,11 +101,16 @@ class Login extends Component {
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
// console.log(response.data.data)
// console.log(response.data.data)
if
(
response
.
data
.
data
.
role_id
===
185
&&
response
.
data
.
maintenance_mode
===
'ACTIVE'
){
let
datas
=
response
.
data
.
data
this
.
props
.
history
.
push
(
'/maintenance'
)
if
(
datas
.
maintenance_status
===
1
)
{
this
.
setState
({
maintenanceHeadline
:
datas
.
maintenance_headline
,
maintenanceContent
:
datas
.
maintenance_content
,
maintenanceStatus
:
datas
.
maintenance_status
})
}
else
{
}
else
{
localStorage
.
setItem
(
Constant
.
TOKEN
,
response
.
data
.
data
.
token
)
localStorage
.
setItem
(
Constant
.
TOKEN
,
datas
.
token
)
localStorage
.
setItem
(
Constant
.
USER
,
response
.
data
.
data
.
user_id
)
localStorage
.
setItem
(
Constant
.
USER
,
datas
.
user_id
)
if
(
this
.
state
.
rememberMe
)
{
if
(
this
.
state
.
rememberMe
)
{
localStorage
.
setItem
(
Constant
.
EMAIL
,
this
.
state
.
email
)
localStorage
.
setItem
(
Constant
.
EMAIL
,
this
.
state
.
email
)
localStorage
.
setItem
(
Constant
.
PASSWORD
,
this
.
state
.
password
)
localStorage
.
setItem
(
Constant
.
PASSWORD
,
this
.
state
.
password
)
...
@@ -113,6 +121,7 @@ class Login extends Component {
...
@@ -113,6 +121,7 @@ class Login extends Component {
}
}
this
.
props
.
history
.
push
(
'/home/beranda'
)
this
.
props
.
history
.
push
(
'/home/beranda'
)
}
}
}
else
{
}
else
{
if
(
response
.
data
.
message
==
'Password is Not Correct'
)
{
if
(
response
.
data
.
message
==
'Password is Not Correct'
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Incorrect Password'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Incorrect Password'
})
...
@@ -149,18 +158,24 @@ class Login extends Component {
...
@@ -149,18 +158,24 @@ class Login extends Component {
<
/Alert
>
<
/Alert
>
<
/Snackbar
>
<
/Snackbar
>
<
div
style
=
{{
width
:
'50%'
,
display
:
'grid'
}}
>
<
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 }} /> */
}
{
/* <img src={Images.imageLogin} style={{ marginTop: 30 }} /> */
}
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#263b80'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
<
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
)
=>
{
<
form
onSubmit
=
{(
e
)
=>
{
e
.
preventDefault
()
e
.
preventDefault
()
this
.
validateLogin
()
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'
}}
>
<
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
<
TextField
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
...
@@ -230,6 +245,7 @@ class Login extends Component {
...
@@ -230,6 +245,7 @@ class Login extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
/form
>
<
/form
>
}
<
/div
>
<
/div
>
<
/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