|
@@ -38,8 +38,9 @@ export default (router) => {
|
|
|
else {
|
|
|
const keys = Object.keys(menu).filter((f) => f !== 'mode');
|
|
|
let toPath = '';
|
|
|
- if (keys.includes('/')) toPath = '/';
|
|
|
- else toPath = _.head(keys);
|
|
|
+ const r = keys.find((f) => to.path.includes(f));
|
|
|
+ if (r) toPath = '/';
|
|
|
+ else toPath = from.path;
|
|
|
next(toPath);
|
|
|
Message.error('您无权限访问该页面');
|
|
|
}
|