...
|
...
|
@@ -9,14 +9,17 @@ export default { |
|
|
if (_.has(rous, 'path')) {
|
|
|
let ps = _.flattenDeep(paths).filter(p => p);
|
|
|
|
|
|
rous.name = _.join(ps, '.');
|
|
|
if (_.last(ps) === rous.name) {
|
|
|
ps = _.dropRight(ps);
|
|
|
}
|
|
|
if (!children) {
|
|
|
if (rous.path) {
|
|
|
rous.path = _.join(_.dropRight(ps, 1), '/') + (rous.path[0] === '/' ? '' : '/') + rous.path;
|
|
|
rous.path = _.join(ps, '/') + (rous.path[0] === '/' ? '' : '/') + rous.path;
|
|
|
} else {
|
|
|
rous.path = _.join(ps, '/') + '.html';
|
|
|
}
|
|
|
}
|
|
|
rous.name = _.join(_.concat(ps, [rous.name]), '.');
|
|
|
|
|
|
if (rous.children) {
|
|
|
_.each(rous.children, child => this.loadRouters(child, [paths, child.name], true));
|
...
|
...
|
@@ -26,7 +29,7 @@ export default { |
|
|
}
|
|
|
if (rous.length) {
|
|
|
return _.map(rous, r => {
|
|
|
return this.loadRouters(r, [paths, r.name]);
|
|
|
return this.loadRouters(r, [paths]);
|
|
|
});
|
|
|
} else {
|
|
|
return _.map(rous, (rou, k) => {
|
...
|
...
|
|