|
@@ -49,11 +49,9 @@ router.beforeEach(async (to, from, next) => {
|
|
for (var route of store.getters.menus) {
|
|
for (var route of store.getters.menus) {
|
|
|
|
|
|
const item = buildRootRoute(route);
|
|
const item = buildRootRoute(route);
|
|
- // console.log(item,'456454');
|
|
|
|
newRoutes.push(item);
|
|
newRoutes.push(item);
|
|
}
|
|
}
|
|
// newRoutes.shift();
|
|
// newRoutes.shift();
|
|
-
|
|
|
|
// 添加一项根目录重定向页面
|
|
// 添加一项根目录重定向页面
|
|
if (newRoutes[0].path != "/") {
|
|
if (newRoutes[0].path != "/") {
|
|
let path = newRoutes[0].path;
|
|
let path = newRoutes[0].path;
|
|
@@ -133,7 +131,6 @@ router.afterEach(() => {
|
|
// }
|
|
// }
|
|
|
|
|
|
function buildRootRoute(route) {
|
|
function buildRootRoute(route) {
|
|
- // console.log(route,1111);
|
|
|
|
const { url, icon, moduleName, moduleId, code, type,fullUrl } = route;
|
|
const { url, icon, moduleName, moduleId, code, type,fullUrl } = route;
|
|
var item = {};
|
|
var item = {};
|
|
item.path = url;
|
|
item.path = url;
|
|
@@ -189,7 +186,6 @@ function buildRootRoute(route) {
|
|
) {
|
|
) {
|
|
|
|
|
|
for (var child of route.children) {
|
|
for (var child of route.children) {
|
|
-
|
|
|
|
item.children.push(buildRoute(child, fullUrl));
|
|
item.children.push(buildRoute(child, fullUrl));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -197,7 +193,6 @@ function buildRootRoute(route) {
|
|
}
|
|
}
|
|
|
|
|
|
function buildRoute(route, p_url) {
|
|
function buildRoute(route, p_url) {
|
|
- // console.log(route,2222);
|
|
|
|
const { url, moduleName, icon, moduleId, code, type, hidden,fullUrl } = route;
|
|
const { url, moduleName, icon, moduleId, code, type, hidden,fullUrl } = route;
|
|
var item = {};
|
|
var item = {};
|
|
if (url.substr(0, 1) == "/") {
|
|
if (url.substr(0, 1) == "/") {
|
|
@@ -248,10 +243,8 @@ function buildRoute(route, p_url) {
|
|
function buildThirdRoute(route, p_url) {
|
|
function buildThirdRoute(route, p_url) {
|
|
|
|
|
|
const { url, moduleName, icon, moduleId, code, hidden, type ,fullUrl } = route;
|
|
const { url, moduleName, icon, moduleId, code, hidden, type ,fullUrl } = route;
|
|
- // console.log(fullUrl,'7878');
|
|
|
|
var item = {};
|
|
var item = {};
|
|
if (url.substr(0, 1) == "/") {
|
|
if (url.substr(0, 1) == "/") {
|
|
- // console.log(url.substr(1),p_url,url);
|
|
|
|
item.path = url.substr(1);
|
|
item.path = url.substr(1);
|
|
} else {
|
|
} else {
|
|
tem.path = url;
|
|
tem.path = url;
|