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
4fc185fd
Commit
4fc185fd
authored
Mar 31, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复开启网关后获取全局配置
parent
68952f56
Pipeline
#47012
passed with stages
in 8 minutes 49 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
micro.js
src/micro.js
+8
-8
login.js
src/pages/user/login/login.js
+0
-0
routes.js
src/utils/routes.js
+2
-2
No files found.
src/micro.js
View file @
4fc185fd
...
...
@@ -37,7 +37,7 @@ const MICRO_STATUS = {
};
export
const
initMicroApps
=
()
=>
{
/* eslint-disable */
const
config
=
window
.
globalConfig
||
{};
//createStoreage.get('globalConfig');
...
...
@@ -190,12 +190,12 @@ export const initMicroApps = () => {
addGlobalUncaughtErrorHandler
(
event
=>
{
console
.
log
(
event
);
});
};
export
const
defaultApp
=
()
=>
{
// eslint-disable-next-line no-undef
const
config
=
window
.
globalConfig
;
...
...
@@ -211,14 +211,14 @@ export const defaultApp = () => {
// createStoreage.set('init_web4', true)
// }
// let homepage = config.homepage.replace('civweb4/', '');
let
url
=
!
config
.
home
?
(
config
.
homepage
===
''
?
`/civbase/civweb4`
:
`/civbase/civweb4/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
).
replace
(
/^civweb4
\/
/
,
''
)}
`
)
:
`/civbase/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
)}
`
;
let
url
=
!
config
.
home
?
(
(
config
.
homepage
===
''
||
_
.
isNull
(
config
.
homepage
))
?
`/civbase/civweb4`
:
`/civbase/civweb4/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
).
replace
(
/^civweb4
\/
/
,
''
)}
`
)
:
`/civbase/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
)}
`
;
/**
* issue 处理监听路由规则
*/
// if(url === '/civbase/civweb4/') {
// url = url.replace(/civweb4\//, 'civweb4');
// }
setDefaultMountApp
(
url
);
// if(config.homepage.indexOf('civweb4') > -1) createStoreage.set('init_web4', true);
}
...
...
@@ -238,7 +238,7 @@ window.app = {
modules
:
{},
require
:
function
(
request
,
method
)
{
if
(
request
!==
'.'
&&
this
.
modules
[
request
])
{
return
_
.
isFunction
(
this
.
modules
[
request
])
?
this
.
modules
[
request
]()
:
_
.
isFunction
(
this
.
modules
[
request
][
method
])
&&
this
.
modules
[
request
][
method
]();
}
...
...
@@ -277,7 +277,7 @@ window.app = {
return
_
.
isFunction
(
this
.
modules
[
request
])
&&
this
.
modules
[
request
]();
},
define
:
function
(
name
,
context
,
index
)
{
let
keys
=
context
.
keys
();
for
(
let
key
of
keys
)
{
let
parts
=
name
.
indexOf
(
'@'
)
>
-
1
?
[
name
,
...(
key
.
slice
(
1
).
split
(
'/'
))]
:
(
name
+
key
.
slice
(
1
)).
split
(
'/'
);
...
...
@@ -293,7 +293,7 @@ window.app = {
dir
[
parts
[
parts
.
length
-
1
]]
=
context
.
bind
(
context
,
key
);
}
if
(
index
&&
index
!==
null
)
{
this
.
modules
[
name
]
=
this
.
modules
[
name
][
index
];
}
},
...
...
src/pages/user/login/login.js
View file @
4fc185fd
This diff is collapsed.
Click to expand it.
src/utils/routes.js
View file @
4fc185fd
...
...
@@ -64,7 +64,7 @@ const generRotes = (widgets, parent, level = 0) => {
const
path
=
`/civweb/
${
guid
(
'web_console'
)}
`
;
const
subKey
=
guid
(
'panda'
);
const
alias
=
DEFAULT_APPLICATION
;
const
convertURL
=
transformURL
(
item
.
icon
.
replace
(
/
\s
*/g
,
''
))
;
const
convertURL
=
item
.
icon
?
transformURL
(
item
.
icon
.
replace
(
/
\s
*/g
,
''
)):
''
;
const
icon
=
(
item
&&
item
.
icon
&&
item
.
icon
!==
null
&&
isAbsoluteURL
(
convertURL
)
?
convertURL
:
/
(\\
|
\/)
/
.
test
(
convertURL
)
?
window
.
globalConfig
.
transformDevAssetsBaseURL
(
transformURL
(
item
.
icon
.
replace
(
/
\s
*/g
,
''
))):
item
.
icon
...
...
@@ -164,7 +164,7 @@ export const transformWidgets = (widgets) => {
return
widgets
.
map
(
item
=>
{
const
widgets
=
item
.
widgets
;
const
homepage
=
window
.
globalConfig
.
homepage
;
const
homePageConvertArray
=
homepage
.
split
(
"/"
)
;
const
homePageConvertArray
=
homepage
?
homepage
.
split
(
"/"
):
[]
;
const
findIndex
=
widgets
&&
widgets
.
findIndex
(
item
=>
item
.
label
===
'系统菜单组'
);
if
(
findIndex
===
-
1
&&
homePageConvertArray
[
0
]
!==
'civweb4'
)
{
const
index
=
widgets
.
findIndex
(
item
=>
item
.
label
===
'首页'
);
...
...
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