Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend
Project
Project
Details
Activity
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
Schedules
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
h5-communicate
frontend
Commits
3b1638c9
Commit
3b1638c9
authored
Jul 28, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
1b2c6202
Pipeline
#16496
passed with stages
in 1 minute
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
CommonLayout.jsx
src/layout/CommonLayout.jsx
+5
-2
No files found.
src/layout/CommonLayout.jsx
View file @
3b1638c9
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
Footer
from
'./Footer'
import
{
withRouter
}
from
'react-router-dom'
import
'./index.less'
...
...
@@ -37,10 +37,12 @@ const CommonLayout = (props) => {
window
.
addEventListener
(
'resize'
,
()
=>
resize
(
defaultH
));
return
()
=>
window
.
removeEventListener
(
'resize'
,
resize
);
},
[]);
const
[
bar
,
setBar
]
=
useState
(
false
);
useEffect
(()
=>
{
const
query
=
queryString
.
parse
(
props
.
location
.
search
);
const
keys
=
Object
.
keys
(
query
);
keys
.
length
>
0
&&
query
.
token
&&
localStorage
.
setItem
(
'token'
,
query
.
token
);
keys
.
length
>
0
&&
query
.
notabar
&&
setBar
(
query
.
notabar
===
'true'
)
},
[]);
return
(
...
...
@@ -50,7 +52,8 @@ const CommonLayout = (props) => {
{
props
.
children
}
</
div
>
</
div
>
<
Footer
{
...
props
}
/>
{
!
bar
&&
<
Footer
{
...
props
}
/>
}
</
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