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
57901879
Commit
57901879
authored
Oct 13, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
755b2adf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
App.js
src/App.js
+1
-1
index.js
src/router/index.js
+9
-0
No files found.
src/App.js
View file @
57901879
...
@@ -7,7 +7,7 @@ import Constant from './library/Constant';
...
@@ -7,7 +7,7 @@ import Constant from './library/Constant';
if
(
sessionStorage
.
getItem
(
'reloaded'
)
!=
null
)
{
if
(
sessionStorage
.
getItem
(
'reloaded'
)
!=
null
)
{
console
.
log
(
'page was reloaded'
);
console
.
log
(
'page was reloaded'
);
}
else
{
}
else
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
//
localStorage.removeItem(Constant.TOKEN)
window
.
location
.
reload
();
window
.
location
.
reload
();
}
}
sessionStorage
.
setItem
(
'reloaded'
,
'yes'
);
sessionStorage
.
setItem
(
'reloaded'
,
'yes'
);
...
...
src/router/index.js
View file @
57901879
...
@@ -26,6 +26,7 @@ import Constant from "../library/Constant";
...
@@ -26,6 +26,7 @@ import Constant from "../library/Constant";
// work properly.
// work properly.
export
default
function
BasicExample
()
{
export
default
function
BasicExample
()
{
return
(
return
(
<
Router
basename
=
{
"/tia-web-dev"
}
>
<
Router
basename
=
{
"/tia-web-dev"
}
>
<
Switch
>
<
Switch
>
...
@@ -57,7 +58,15 @@ export default function BasicExample() {
...
@@ -57,7 +58,15 @@ export default function BasicExample() {
}
}
function
PrivateRoute
({
children
,
...
rest
})
{
function
PrivateRoute
({
children
,
...
rest
})
{
// React.useEffect(() => {
// token()
// })
const
logged
=
localStorage
.
getItem
(
Constant
.
TOKEN
)
!==
null
?
true
:
false
const
logged
=
localStorage
.
getItem
(
Constant
.
TOKEN
)
!==
null
?
true
:
false
// const token = async() => {
// let a = await localStorage.getItem(Constant.TOKEN)
// alert(a)
// }
return
(
return
(
<
Route
<
Route
{...
rest
}
{...
rest
}
...
...
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