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
e18c969d
Commit
e18c969d
authored
Feb 01, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update kit_global_config
parent
d92c9e5c
Pipeline
#23278
skipped with stages
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
46 deletions
+45
-46
reducer.js
src/containers/App/store/reducer.js
+11
-1
BasicLayout.js
src/layouts/BasicLayout.js
+21
-12
Site.js
src/layouts/Site.js
+7
-3
micro.js
src/micro.js
+0
-8
login.js
src/pages/user/login/login.js
+1
-1
config.js
src/routes/config.js
+1
-11
routes.js
src/utils/routes.js
+2
-1
utils.js
src/utils/utils.js
+2
-9
No files found.
src/containers/App/store/reducer.js
View file @
e18c969d
...
...
@@ -89,7 +89,17 @@ const appReducer = (state = initialState, action) => {
// eslint-disable-next-line no-undef,no-case-declarations
const
config
=
window
.
globalConfig
;
// eslint-disable-next-line no-case-declarations
const
generMenu
=
generRoutes
(
config
.
widgets
||
[]);
let
generMenu
=
generRoutes
(
config
.
widgets
||
[]);
// eslint-disable-next-line no-case-declarations
const
{
homepage
}
=
window
.
globalConfig
;
if
(
homepage
!==
''
)
{
const
index
=
generMenu
.
findIndex
(
item
=>
item
.
level
===
-
1
&&
item
.
url
!==
''
,
);
if
(
index
>
-
1
)
{
generMenu
=
generMenu
.
reverse
();
}
}
// eslint-disable-next-line no-case-declarations
const
flatMenu
=
generFlatRoutes
(
generMenu
||
[]);
return
state
.
merge
({
...
...
src/layouts/BasicLayout.js
View file @
e18c969d
...
...
@@ -376,17 +376,26 @@ const BasicLayout = props => {
},
[
props
.
location
.
pathname
,
currentRoutes
]);
// useEffect(() => {
// const menu = props.menu.filter(item => !item.hideInMenu);
// if(menu.length === 0) {
// setLoading(true);
// }
// 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]);
// setLoading(false);
// }
// }, [props.currentMenuIndex, props.route, props.menu]);
// setLoading(true);
//
//
// debugger
//
// setTimeout(() => {
// debugger
// const routes = props.route.routes;
// if(routes.length > 0 && props.currentMenuIndex !== -1) {
// if(currentRoutes && !currentRoutes.routes) {
// setCurrentRoutes(props.route.routes[props.currentMenuIndex]);
// setLoading(false);
// }
//
// }
//
// }, 400)
//
// }, [props.currentMenuIndex, props.route]);
//
useEffect
(()
=>
{
setLoading
(
true
);
clearTime
=
setTimeout
(()
=>
{
...
...
@@ -573,7 +582,7 @@ const BasicLayout = props => {
title
:
props
.
global
&&
props
.
global
.
get
(
'title'
)
||
defaultSetting
.
title
});
const
logo
=
props
.
global
.
get
(
'bannerLogo'
)
?
`http://panda-water.cn/web4/
${
props
.
global
.
get
(
'bannerLogo'
)}
`
:
defaultSetting
.
logo
;
const
logo
=
props
.
global
.
get
(
'bannerLogo'
)
?
window
.
globalConfig
.
transformDevAssetsBaseURL
(
props
.
global
.
get
(
'bannerLogo'
))
:
defaultSetting
.
logo
;
const
renderComplexLayout
=
children
=>
{
const
complexConfig
=
props
.
complexConfig
.
toJS
?
props
.
complexConfig
.
toJS
()
...
...
src/layouts/Site.js
View file @
e18c969d
...
...
@@ -165,7 +165,7 @@ class Site {
self
.
globalConfig
.
userInfo
.
groupType
=
allStation
[
0
].
groupType
;
}
}
debugger
debugger
;
if
(
allStation
.
length
>
1
)
{
self
.
currentStationName
=
arr
[
arr
.
length
-
1
];
self
.
citySelector
=
self
.
AvailableofRegionName
(
projectStation
);
...
...
@@ -347,9 +347,13 @@ 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
.
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
.
share
.
event
.
emit
(
'triggerMicro'
,
this
.
props
.
global
);
});
...
...
src/micro.js
View file @
e18c969d
...
...
@@ -29,13 +29,9 @@ const MICRO_STATUS = {
};
export
const
initMicroApps
=
(
loader
,
store
)
=>
{
<<<<<<<
HEAD
console
.
log
(
window
.
globalConfig
);
=======
/* eslint-disable */
const
config
=
createStoreage
.
get
(
'globalConfig'
);
const
application
=
config
.
products
||
[];
>>>>>>>
d395e004dcda0c599173220f273809c42294cca2
const
entrys
=
process
.
env
.
NODE_ENV
!==
'production'
?
micorConfig
.
dev
...
...
@@ -74,10 +70,6 @@ export const initMicroApps = (loader, store) => {
],
beforeMount
:
[
app
=>
{
<<<<<<<
HEAD
store
.
dispatch
(
actionCreators
.
updateMicroMounted
(
false
));
=======
>>>>>>>
0
e8f6915ac6e5dc6a04d3511197675755ca3bc00
Logger
.
info
(
`[LifeCycle] before mount %c%s
${
app
.
name
}
`
);
},
],
...
...
src/pages/user/login/login.js
View file @
e18c969d
...
...
@@ -704,7 +704,7 @@ class Login {
return
data
}
else
{
message
.
error
({
duration
:
20
00
,
duration
:
3
00
,
content
:
`授权失败:
${
res
.
msg
}
`
});
self
.
events
.
emit
(
'loginError'
,
res
.
msg
);
...
...
src/routes/config.js
View file @
e18c969d
...
...
@@ -29,17 +29,7 @@ export const dyRoutes = routes => {
{
path
:
'/'
,
component
:
BasicLayout
,
routes
:
[
...
dyRoutes
,
{
path
:
'/404'
,
component
:
NotFound
,
},
{
path
:
'/500'
,
component
:
ServiceFail
,
},
],
routes
:
dyRoutes
,
},
{
path
:
'/404'
,
...
...
src/utils/routes.js
View file @
e18c969d
...
...
@@ -71,7 +71,8 @@ const generRotes = (widgets, parent, level = 0) => {
});
}
else
{
const
baseURL
=
item
.
product
||
DEFAULT_APPLICATION
;
let
url
=
item
.
hasOwnProperty
(
'url'
)
&&
item
.
url
!==
undefined
?
`/
${
baseURL
}
/
${
item
.
url
.
replace
(
/
\s
*/g
,
''
)}
`
if
(
item
.
hasOwnProperty
(
'url'
)
&&
item
.
url
===
''
)
return
;
let
url
=
item
.
hasOwnProperty
(
'url'
)
&&
item
.
url
!==
undefined
&&
item
.
url
!==
''
?
`/
${
baseURL
}
/
${
item
.
url
.
replace
(
/
\s
*/g
,
''
)}
`
:
!
item
.
hasOwnProperty
(
'url'
)
?
guid
(
'web_console'
)
:
''
;
...
...
src/utils/utils.js
View file @
e18c969d
...
...
@@ -158,18 +158,11 @@ export const asyncAction = action => {
wait
.
then
(()
=>
setTimeout
(()
=>
callback
()));
};
};
export
const
combineURLs
=
(
baseURL
,
relativeURL
)
=>
{
return
relativeURL
?
baseURL
.
replace
(
/
\/
+$/
,
''
)
+
'/'
+
relativeURL
.
replace
(
/^
\/
+/
,
''
):
baseURL
;
}
export
function
getAssetsURL
(
relativeURL
)
{
//CityTemp 后端约定的本地文件夹路径
if
(
!
relativeURL
)
return
;
return
combineURLs
(
window
.
location
.
origin
,
relativeURL
);
}
export
function
getToken
()
{
return
Cookies
.
get
(
'token'
);
};
export
function
setToken
(
token
)
{
Cookies
.
set
(
token
)
Cookies
.
set
(
token
)
;
}
export
const
closeTabAction
=
(
history
,
returnUrl
,
callback
)
=>
{};
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