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
7278f663
Commit
7278f663
authored
3 years ago
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复首页路由匹配
parent
8c6dbdc6
Pipeline
#42218
passed with stages
in 1 minute 36 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
BasicLayout1.js
src/layouts/BasicLayout1.js
+2
-1
routes.js
src/utils/routes.js
+1
-0
utils.js
src/utils/utils.js
+2
-0
No files found.
src/layouts/BasicLayout1.js
View file @
7278f663
...
...
@@ -271,6 +271,7 @@ const BasicLayout = props => {
// 处理隐藏菜单
let
currentRoutes
=
props
.
route
.
routes
.
filter
(
item
=>
!
item
.
hideInMenu
)[
props
.
currentMenuIndex
];
console
.
log
(
props
.
route
)
//props.currentMenuIndex
useEffect
(()
=>
{
const
initSelectRoute
=
findPathByLeafId
(
...
...
@@ -330,7 +331,7 @@ const BasicLayout = props => {
useEffect
(()
=>
{
siteAction
.
setGlobalConfig
(
props
.
global
);
if
(
!
Cookies
.
get
(
'token'
))
{
let
client
=
props
.
global
.
get
(
'client'
)
;
let
client
=
props
.
global
&&
props
.
global
.
client
;
client
=
client
!==
'undefined'
||
!
_
.
isNull
(
client
)
||
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
history
.
replace
(
`/user/login?client=
${
client
}
`
);
props
.
logout
();
...
...
This diff is collapsed.
Click to expand it.
src/utils/routes.js
View file @
7278f663
...
...
@@ -87,6 +87,7 @@ const generRotes = (widgets, parent, level = 0) => {
url
=
item
.
url
}
url
=
transformURL
(
url
);
url
=
url
.
replace
(
/
[
(
\\
|)|(&)
]
widget=
[
0-9
]
*/
,
''
)
const
convertURL
=
item
.
icon
&&
transformURL
(
item
.
icon
.
replace
(
/
\s
*/g
,
''
));
const
icon
=
(
item
&&
item
.
icon
&&
item
.
icon
!==
null
&&
isAbsoluteURL
(
convertURL
)
?
convertURL
:
/
(\\
|
\/)
/
.
test
(
convertURL
)
?
...
...
This diff is collapsed.
Click to expand it.
src/utils/utils.js
View file @
7278f663
...
...
@@ -87,6 +87,8 @@ export function findPathByLeafId(leafId, nodes, path, key, clear) {
}
export
function
transformURL
(
path
)
{
//civweb4/
path
=
path
.
replace
(
/
[
(
\\
|)|(&)
]
widget=
[
0-9
]
*/
,
''
);
const
el
=
document
.
createElement
(
'input'
);
el
.
value
=
path
;
String
.
fromCharCode
(
92
);
...
...
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