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
4 years ago
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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
42 deletions
+41
-42
reducer.js
src/containers/App/store/reducer.js
+11
-1
BasicLayout.js
src/layouts/BasicLayout.js
+17
-8
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
({
...
...
This diff is collapsed.
Click to expand it.
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) {
//
//
// 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);
// }
// }, [props.currentMenuIndex, props.route, props.menu]);
//
// }
//
// }, 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
()
...
...
This diff is collapsed.
Click to expand it.
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
);
});
...
...
This diff is collapsed.
Click to expand it.
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
}
`
);
},
],
...
...
This diff is collapsed.
Click to expand it.
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
);
...
...
This diff is collapsed.
Click to expand it.
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'
,
...
...
This diff is collapsed.
Click to expand it.
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'
)
:
''
;
...
...
This diff is collapsed.
Click to expand it.
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
)
=>
{};
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