Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
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
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
ReactWeb5
CivWeb
Commits
a5f82f10
Commit
a5f82f10
authored
Jan 28, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: basic layout load mircro bug
parent
d9fe2826
Pipeline
#23192
skipped with stages
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
16 deletions
+27
-16
port.js
server/port.js
+1
-1
AvatarDropdown.js
src/components/GlobalHeader/AvatarDropdown.js
+2
-2
BasicLayout.js
src/layouts/BasicLayout.js
+22
-13
Site.js
src/layouts/Site.js
+2
-0
No files found.
server/port.js
View file @
a5f82f10
const
argv
=
require
(
'./argv'
);
console
.
log
(
argv
.
port
)
module
.
exports
=
parseInt
(
argv
.
port
||
process
.
env
.
PORT
||
'300
5
'
,
10
);
module
.
exports
=
parseInt
(
argv
.
port
||
process
.
env
.
PORT
||
'300
4
'
,
10
);
src/components/GlobalHeader/AvatarDropdown.js
View file @
a5f82f10
...
...
@@ -71,7 +71,7 @@ class AvatarDropdown extends React.Component {
Cookies
.
set
(
'site'
,
''
,
{
path
:
'/'
,
});
localStorage
.
removeItem
(
'access_token'
);
if
(
window
.
globalConfig
.
style
===
'ios'
&&
window
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
...
...
@@ -79,7 +79,7 @@ class AvatarDropdown extends React.Component {
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/#login`
;
return
false
;
}
debugger
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
this
.
props
.
updateConfig
&&
this
.
props
.
updateConfig
({});
this
.
props
.
updateComplexConfig
&&
this
.
props
.
updateComplexConfig
({});
...
...
src/layouts/BasicLayout.js
View file @
a5f82f10
...
...
@@ -389,25 +389,35 @@ const BasicLayout = props => {
// }, [props.currentMenuIndex, props.route, props.menu]);
useEffect
(()
=>
{
setLoading
(
true
);
clearTime
=
setTimeout
(()
=>
(
setCurrentRoutes
(
props
.
route
.
routes
[
props
.
currentMenuIndex
]),
setLoading
(
false
)),
400
);
return
()
=>
clearTimeout
&&
clearTimeout
(
clearTime
);
},
[
props
.
currentMenuIndex
]);
useEffect
(()
=>
{
const
menu
=
props
.
menu
.
filter
(
item
=>
!
item
.
hideInMenu
);
setLoading
(
true
);
clearTime
=
setTimeout
(()
=>
{
props
.
route
&&
(
props
.
route
.
routes
.
filter
(
item
=>
!
item
.
hideInMenu
||
item
.
path
!==
'/404'
||
item
.
path
!==
'/500'
)).
length
===
0
&&
setLoading
(
true
);
if
(
menu
.
length
>
0
&&
props
.
route
&&
props
.
route
.
routes
.
length
>
0
)
{
if
(
props
.
currentMenuIndex
!==
-
1
)
{
setCurrentRoutes
(
props
.
route
.
routes
[
props
.
currentMenuIndex
]);
setLoading
(
false
);
}
},
400
);
return
()
=>
clearTimeout
&&
clearTimeout
(
clearTime
);
},
[
props
.
menu
]);
},
[
props
.
currentMenuIndex
]);
// useEffect(() => {
// debugger
// // const menu = props.menu.filter(item => !item.hideInMenu);
// setLoading(true);
// setCurrentRoutes([]);
// clearTime = setTimeout(() => {
// debugger
// // props.route && (props.route.routes.filter(item => !item.hideInMenu || item.path !== '/404' || item.path !== '/500')).length === 0 && setLoading(true);
// if(props.route && props.route.routes.length > 0 && props.route.routes[props.currentMenuIndex].path !== currentRoutes.path) {
// setCurrentRoutes(props.route.routes[props.currentMenuIndex]);
// setLoading(false);
// }
// }, 400);
// return () => clearTimeout && clearTimeout(clearTime);
// }, [props.route]);
useEffect
(()
=>
{
siteAction
.
setGlobalConfig
(
props
.
global
);
...
...
@@ -565,7 +575,6 @@ const BasicLayout = props => {
});
const
logo
=
props
.
global
.
get
(
'bannerLogo'
)
?
`http://panda-water.cn/web4/
${
props
.
global
.
get
(
'bannerLogo'
)}
`
:
defaultSetting
.
logo
;
const
renderComplexLayout
=
children
=>
{
const
complexConfig
=
props
.
complexConfig
.
toJS
?
props
.
complexConfig
.
toJS
()
...
...
src/layouts/Site.js
View file @
a5f82f10
...
...
@@ -334,6 +334,7 @@ class Site {
loginSite
[
token
]
=
site
;
localStorage
.
setItem
(
'loginSite'
,
JSON
.
stringify
(
loginSite
));
const
self
=
this
;
self
.
props
.
updateCurrentIndex
&&
self
.
props
.
updateCurrentIndex
(
-
1
);
const
login
=
new
Login
(
this
.
props
,
()
=>
{
self
.
setLoading
(
false
);
// eslint-disable-next-line no-unused-expressions
...
...
@@ -346,6 +347,7 @@ class Site {
self
.
getCityStationsForUser
().
then
(
res
=>
{
window
.
share
.
event
.
emit
(
'updateSite'
,
res
);
});
self
.
props
&&
self
.
props
.
updateCollapsed
&&
self
.
props
.
updateCollapsed
(
false
);
self
.
props
&&
self
.
props
.
updateComplexConfig
&&
self
.
props
.
updateComplexConfig
({});
// window.location.reload();
...
...
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