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