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
d395e004
Commit
d395e004
authored
Feb 01, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Plain Diff
fix: 修改静态资源问题
parents
76b86c75
0e8f6915
Pipeline
#23272
skipped with stages
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
+31
-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
micro.js
src/micro.js
+4
-0
No files found.
server/port.js
View file @
d395e004
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 @
d395e004
...
...
@@ -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 @
d395e004
...
...
@@ -388,25 +388,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
);
...
...
@@ -564,7 +574,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 @
d395e004
...
...
@@ -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();
...
...
src/micro.js
View file @
d395e004
...
...
@@ -69,12 +69,16 @@ export const initMicroApps = (loader, store) => {
],
beforeMount
:
[
app
=>
{
<<<<<<<
HEAD
store
.
dispatch
(
actionCreators
.
updateMicroMounted
(
false
));
=======
>>>>>>>
0
e8f6915ac6e5dc6a04d3511197675755ca3bc00
Logger
.
info
(
`[LifeCycle] before mount %c%s
${
app
.
name
}
`
);
},
],
afterMount
:
[
app
=>
{
store
.
dispatch
(
actionCreators
.
updateMicroMounted
(
false
));
Logger
.
info
(
`[LifeCycle] after mount %c%s
${
app
.
name
}
`
);
},
],
...
...
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