From 9b4a1d223d7da8da4356450c02114a0f8e0b746b Mon Sep 17 00:00:00 2001 From: zhangchuanlong Date: Tue, 25 Jan 2022 15:21:55 +0800 Subject: [PATCH] =?UTF-8?q?mod:=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90=E7=9A=84?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/permission.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index aca9de3..d23c1f7 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,13 +1,12 @@ import { defineStore } from 'pinia' import { asyncRoutes, basicRoutes } from '@/router/routes' -import { difference } from 'lodash-es' function hasPermission(route, role) { const routeRole = route.meta?.role ? route.meta.role : [] if (!role.length || !routeRole.length) { return false } - return difference(routeRole, role).length < routeRole.length + return role.some((item) => routeRole.includes(item)) } function filterAsyncRoutes(routes = [], role) {