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
4 years ago
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
17 deletions
+28
-17
port.js
server/port.js
+1
-1
AvatarDropdown.js
src/components/GlobalHeader/AvatarDropdown.js
+2
-2
BasicLayout.js
src/layouts/BasicLayout.js
+23
-14
Site.js
src/layouts/Site.js
+2
-0
No files found.
server/port.js
View file @
a5f82f10
const
argv
=
require
(
'./argv'
);
const
argv
=
require
(
'./argv'
);
console
.
log
(
argv
.
port
)
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
);
This diff is collapsed.
Click to expand it.
src/components/GlobalHeader/AvatarDropdown.js
View file @
a5f82f10
...
@@ -71,7 +71,7 @@ class AvatarDropdown extends React.Component {
...
@@ -71,7 +71,7 @@ class AvatarDropdown extends React.Component {
Cookies
.
set
(
'site'
,
''
,
{
Cookies
.
set
(
'site'
,
''
,
{
path
:
'/'
,
path
:
'/'
,
});
});
localStorage
.
removeItem
(
'access_token'
);
if
(
if
(
window
.
globalConfig
.
style
===
'ios'
&&
window
.
globalConfig
.
style
===
'ios'
&&
window
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
window
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
...
@@ -79,7 +79,7 @@ class AvatarDropdown extends React.Component {
...
@@ -79,7 +79,7 @@ class AvatarDropdown extends React.Component {
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/#login`
;
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/#login`
;
return
false
;
return
false
;
}
}
debugger
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
this
.
props
.
updateConfig
&&
this
.
props
.
updateConfig
({});
this
.
props
.
updateConfig
&&
this
.
props
.
updateConfig
({});
this
.
props
.
updateComplexConfig
&&
this
.
props
.
updateComplexConfig
({});
this
.
props
.
updateComplexConfig
&&
this
.
props
.
updateComplexConfig
({});
...
...
This diff is collapsed.
Click to expand it.
src/layouts/BasicLayout.js
View file @
a5f82f10
...
@@ -390,24 +390,34 @@ const BasicLayout = props => {
...
@@ -390,24 +390,34 @@ const BasicLayout = props => {
useEffect
(()
=>
{
useEffect
(()
=>
{
setLoading
(
true
);
setLoading
(
true
);
clearTime
=
setTimeout
(()
=>
(
setCurrentRoutes
(
props
.
route
.
routes
[
props
.
currentMenuIndex
]),
setLoading
(
false
)),
400
);
clearTime
=
setTimeout
(()
=>
{
return
()
=>
clearTimeout
&&
clearTimeout
(
clearTime
);
if
(
props
.
currentMenuIndex
!==
-
1
)
{
},
[
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
)
{
setCurrentRoutes
(
props
.
route
.
routes
[
props
.
currentMenuIndex
]);
setCurrentRoutes
(
props
.
route
.
routes
[
props
.
currentMenuIndex
]);
setLoading
(
false
);
setLoading
(
false
);
}
}
},
400
);
},
400
);
return
()
=>
clearTimeout
&&
clearTimeout
(
clearTime
);
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
(()
=>
{
useEffect
(()
=>
{
siteAction
.
setGlobalConfig
(
props
.
global
);
siteAction
.
setGlobalConfig
(
props
.
global
);
...
@@ -565,7 +575,6 @@ const BasicLayout = props => {
...
@@ -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
logo
=
props
.
global
.
get
(
'bannerLogo'
)
?
`http://panda-water.cn/web4/
${
props
.
global
.
get
(
'bannerLogo'
)}
`
:
defaultSetting
.
logo
;
const
renderComplexLayout
=
children
=>
{
const
renderComplexLayout
=
children
=>
{
const
complexConfig
=
props
.
complexConfig
.
toJS
const
complexConfig
=
props
.
complexConfig
.
toJS
?
props
.
complexConfig
.
toJS
()
?
props
.
complexConfig
.
toJS
()
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Site.js
View file @
a5f82f10
...
@@ -334,6 +334,7 @@ class Site {
...
@@ -334,6 +334,7 @@ class Site {
loginSite
[
token
]
=
site
;
loginSite
[
token
]
=
site
;
localStorage
.
setItem
(
'loginSite'
,
JSON
.
stringify
(
loginSite
));
localStorage
.
setItem
(
'loginSite'
,
JSON
.
stringify
(
loginSite
));
const
self
=
this
;
const
self
=
this
;
self
.
props
.
updateCurrentIndex
&&
self
.
props
.
updateCurrentIndex
(
-
1
);
const
login
=
new
Login
(
this
.
props
,
()
=>
{
const
login
=
new
Login
(
this
.
props
,
()
=>
{
self
.
setLoading
(
false
);
self
.
setLoading
(
false
);
// eslint-disable-next-line no-unused-expressions
// eslint-disable-next-line no-unused-expressions
...
@@ -346,6 +347,7 @@ class Site {
...
@@ -346,6 +347,7 @@ class Site {
self
.
getCityStationsForUser
().
then
(
res
=>
{
self
.
getCityStationsForUser
().
then
(
res
=>
{
window
.
share
.
event
.
emit
(
'updateSite'
,
res
);
window
.
share
.
event
.
emit
(
'updateSite'
,
res
);
});
});
self
.
props
&&
self
.
props
.
updateCollapsed
&&
self
.
props
.
updateCollapsed
(
false
);
self
.
props
&&
self
.
props
.
updateComplexConfig
&&
self
.
props
.
updateComplexConfig
({});
self
.
props
&&
self
.
props
.
updateComplexConfig
&&
self
.
props
.
updateComplexConfig
({});
// window.location.reload();
// window.location.reload();
...
...
This diff is collapsed.
Click to expand it.
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