Commit 57901879 authored by d.arizona's avatar d.arizona

update

parent 755b2adf
...@@ -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');
......
...@@ -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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment