Parcourir la source

Merge branch 'one' of http://git.cc-lotus.info/pointToNetwork/web-admin into one

zs il y a 1 an
Parent
commit
a589027c4b
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      src/router/guard.js

+ 7 - 1
src/router/guard.js

@@ -6,7 +6,13 @@ import { Message } from 'element-ui';
 export default (router) => {
   router.beforeEach((to, from, next) => {
     if (to.path.includes('dev')) {
-      if (!$dev_env) next('/');
+      if (_.get(store, 'state.user.role.code') === 'sadmin') {
+        next();
+        return;
+      } else if (!$dev_env) {
+        next('/');
+        return;
+      }
     }
     // 检查是不是登陆,登陆页面放过
     if (to.path === '/login') {