Browse Source

修复路由问题

shibei_master
dai 3 years ago
parent
commit
fe71013838
  1. 17
      src/router/index.js

17
src/router/index.js

@ -402,8 +402,21 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
eval(s2)
); // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
if (menuList[i].children && menuList[i].children.length >= 1) {
let item = menuList[i].children.find(
(subMenu) => subMenu.url == menuList[i].url
);
if (item) {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["redirect"] = `i-${item.id}`;
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else {
URL = URL.replace(/^\//, "").replace(/_/g, "-");
if (URL.startsWith("unopen")) {

Loading…
Cancel
Save