ソースを参照

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

zs 1 年間 前
コミット
a589027c4b
1 ファイル変更7 行追加1 行削除
  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') {