Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ant-design-pro
Project
Project
Details
Activity
Releases
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thiago Borges
ant-design-pro
Commits
27266c56
You need to sign in or sign up before continuing.
Commit
27266c56
authored
Feb 26, 2018
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #972 delete extra /
parent
74f50288
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
router.js
src/common/router.js
+1
-1
BasicLayout.js
src/layouts/BasicLayout.js
+2
-2
No files found.
src/common/router.js
View file @
27266c56
...
@@ -175,7 +175,7 @@ export const getRouterData = (app) => {
...
@@ -175,7 +175,7 @@ export const getRouterData = (app) => {
// Regular match item name
// Regular match item name
// eg. router /user/:id === /user/chen
// eg. router /user/:id === /user/chen
const
pathRegexp
=
pathToRegexp
(
path
);
const
pathRegexp
=
pathToRegexp
(
path
);
const
menuKey
=
Object
.
keys
(
menuData
).
find
(
key
=>
pathRegexp
.
test
(
`
/
${
key
}
`
));
const
menuKey
=
Object
.
keys
(
menuData
).
find
(
key
=>
pathRegexp
.
test
(
`
${
key
}
`
));
let
menuItem
=
{};
let
menuItem
=
{};
// If menuKey is not empty
// If menuKey is not empty
if
(
menuKey
)
{
if
(
menuKey
)
{
...
...
src/layouts/BasicLayout.js
View file @
27266c56
...
@@ -27,8 +27,8 @@ const getRedirect = (item) => {
...
@@ -27,8 +27,8 @@ const getRedirect = (item) => {
if
(
item
&&
item
.
children
)
{
if
(
item
&&
item
.
children
)
{
if
(
item
.
children
[
0
]
&&
item
.
children
[
0
].
path
)
{
if
(
item
.
children
[
0
]
&&
item
.
children
[
0
].
path
)
{
redirectData
.
push
({
redirectData
.
push
({
from
:
`
/
${
item
.
path
}
`
,
from
:
`
${
item
.
path
}
`
,
to
:
`
/
${
item
.
children
[
0
].
path
}
`
,
to
:
`
${
item
.
children
[
0
].
path
}
`
,
});
});
item
.
children
.
forEach
((
children
)
=>
{
item
.
children
.
forEach
((
children
)
=>
{
getRedirect
(
children
);
getRedirect
(
children
);
...
...
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