|
|
@@ -11,9 +11,10 @@ const formatRouter = (list) => {
|
|
|
const fn = (list, pPath = '') => {
|
|
|
let arr = [];
|
|
|
for (const p of list) {
|
|
|
- p.path = pPath ? `${pPath}${p.path}` : p.path;
|
|
|
+ let curPath = pPath;
|
|
|
+ p.path = curPath ? `${curPath}${p.path}` : p.path;
|
|
|
if (p.parentId === '0') {
|
|
|
- pPath = p.path;
|
|
|
+ curPath = p.path;
|
|
|
}
|
|
|
p.component = '';
|
|
|
if (p.menuType === 2) {
|
|
|
@@ -21,7 +22,7 @@ const formatRouter = (list) => {
|
|
|
authorities.push(p);
|
|
|
} else {
|
|
|
if (p.children?.length) {
|
|
|
- p.children = fn(p.children, pPath);
|
|
|
+ p.children = fn(p.children, curPath);
|
|
|
} else {
|
|
|
p.children = [];
|
|
|
}
|