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
c0898c4f
Commit
c0898c4f
authored
Apr 15, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token expired
parent
0a799d7b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
6 deletions
+50
-6
HomePage.js
src/container/HomePage.js
+18
-4
DashboardCAT.js
src/container/Laporan/DashboardCAT.js
+16
-0
DashboardFinancial.js
src/container/Laporan/DashboardFinancial.js
+16
-2
No files found.
src/container/HomePage.js
View file @
c0898c4f
...
...
@@ -71,11 +71,25 @@ class HomePage extends Component {
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
userData
:
response
.
data
.
data
},
()
=>
{
// console.log(this.state.userData)
this
.
setState
({
userData
:
response
.
data
.
data
})
// console.log(response.data.data)
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
// api.create().checkApprover().then(response => {
...
...
src/container/Laporan/DashboardCAT.js
View file @
c0898c4f
...
...
@@ -82,8 +82,24 @@ export default class DashboardCAT extends Component {
this
.
getCompanyActive
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
// }
// }
})
}
...
...
src/container/Laporan/DashboardFinancial.js
View file @
c0898c4f
...
...
@@ -104,7 +104,21 @@ export default class DashboardFinancial extends React.Component {
this
.
getCompanyActive
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
...
...
@@ -132,7 +146,7 @@ export default class DashboardFinancial extends React.Component {
})
let
defaultProps
=
{
options
:
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
)),
options
:
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
)),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
...
...
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