lrf пре 2 година
родитељ
комит
87bac4fd1b
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      src/router/guard.js

+ 3 - 2
src/router/guard.js

@@ -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('您无权限访问该页面');
     }