Explorar el Código

improve: 鉴权

From-wh hace 2 años
padre
commit
8e84eaf838
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      template/admin/src/router/index.js

+ 2 - 2
template/admin/src/router/index.js

@@ -106,8 +106,8 @@ router.beforeEach(async (to, from, next) => {
     const token = getCookies('token');
     if (token && token !== 'undefined') {
       const access = store.state.userInfo.uniqueAuth;
-      const isPermission = includeArray(to.meta.auth, access);
-      if (isPermission) {
+      const isPermission = includeArray(to.meta.auth, access); //  判断是否有权限  TODO
+      if (access.length) {
         next();
       } else {
         if (access.length == 0) {