Commit 27266c56 authored by jim's avatar jim

fix #972 delete extra /

parent 74f50288
...@@ -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) {
......
...@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment