From 8e84eaf838d3bdd9835c852bdcb6f9aca9a873cf Mon Sep 17 00:00:00 2001 From: From-wh Date: Fri, 28 Apr 2023 14:11:02 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20=E9=89=B4=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/router/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/admin/src/router/index.js b/template/admin/src/router/index.js index c73b193ea..b74fbc4cf 100644 --- a/template/admin/src/router/index.js +++ b/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) {